Allow stores of bitcastable types to be merged by peeking through BITCAST nodes and recasting stored values constant and vector extract nodes as necessary.
Details
Diff Detail
- Build Status
Buildable 9202 Build 9202: arc lint + arc unit
Event Timeline
Ignore this last patch. It should have gone to another diff. Will overwrite with correct version presently.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
12643 | It'd probably be better if you avoid the ternary inside the if(). if (MemVT.isInteger() && !MemVT.bitsEq(Other->getMemoryVT())) return false; if (!MemVT.isInteger() && Other->getMemoryVT() != MemVT) return false; or if ((MemVT.isInteger() && !MemVT.bitsEq(Other->getMemoryVT())) || (!MemVT.isInteger() && Other->getMemoryVT() != MemVT)) return false; That or pull it out as a bool variable in the line above. | |
12655 | Another ternary inside an if() |
Cleanup the mergestore helper function casting and add missing extract_subvector casting logic.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
483–484 | A lot of these comment changes look like NFCs that can go in separately. | |
12482 | Please can you create a static helper that performs this? We have a lot of peek through bitcasts in this patch alone.... | |
12484 | Val.getValueSizeInBits() | |
12518 | Merge these ifs() to reduce indentation? if (MemVT != Val.getValueType() && (Val.getOpcode() == ISD::EXTRACT_VECTOR_ELT || Val.getOpcode() == ISD::EXTRACT_SUBVECTOR) { |
A lot of these comment changes look like NFCs that can go in separately.