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 7541 Build 7541: 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 | ||
---|---|---|
12448 | 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. | |
12458 | Another ternary inside an if() |
Cleanup the mergestore helper function casting and add missing extract_subvector casting logic.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
483 | A lot of these comment changes look like NFCs that can go in separately. | |
12316 | Please can you create a static helper that performs this? We have a lot of peek through bitcasts in this patch alone.... | |
12318 | Val.getValueSizeInBits() | |
12346 | 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.