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