While working on some unit tests for an optimization, i discovered some cases where live-in computation eliminations useless phis for MemorySSA.
The calculation is cheap, and we can always disable it later, so enable it for now.
Details
Diff Detail
Event Timeline
lib/Transforms/Utils/MemorySSA.cpp | ||
---|---|---|
264 | In case the change made here isn't obvious - we used to try to insert the block into the set *for each relevant instruction we found in the block* (IE N attempts per block), and now we only insert it into the set once per block. |
This LGTM. An argument could be made, either for or against, that the change to minimize the number of attempts to update DefiningBlocks could be split out.
lib/Transforms/Utils/MemorySSA.cpp | ||
---|---|---|
308–313 | Any reason not to use the range-based predecessors? for (BasicBlock *P : predecessors(BB)) LiveInBlockWorklist.push_back(P); I guess you could also use append instead: LiveInBlockWorklist.append(pred_begin(BB), pred_end(BB)); | |
test/Transforms/Util/MemorySSA/livein.ll | ||
27 | Would you mind adding a space between that semicolon and the CHECK to match the others? |
In case the change made here isn't obvious - we used to try to insert the block into the set *for each relevant instruction we found in the block* (IE N attempts per block), and now we only insert it into the set once per block.