aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorFlorian Hahn <florian_hahn@apple.com>2020-08-11 11:15:20 +0200
committerDávid Bolvanský <david.bolvansky@gmail.com>2020-08-11 11:18:12 +0200
commit0b774acf1189f589140ad49e9146e1406be91ca1 (patch)
tree44eee54267f69b28376a8760bc56233cc841e142 /clang/lib/CodeGen/CodeGenModule.cpp
parent3ce57e012110519c1d3a49fc98959a64634d5d8f (diff)
downloadllvm-0b774acf1189f589140ad49e9146e1406be91ca1.zip
llvm-0b774acf1189f589140ad49e9146e1406be91ca1.tar.gz
llvm-0b774acf1189f589140ad49e9146e1406be91ca1.tar.bz2
[SLP] Make sure instructions are ordered when computing spill cost.
The entries in VectorizableTree are not necessarily ordered by their position in basic blocks. Collect them and order them by dominance so later instructions are guaranteed to be visited first. For instructions in different basic blocks, we only scan to the beginning of the block, so their order does not matter, as long as all instructions in a basic block are grouped together. Using dominance ensures a deterministic order. The modified test case contains an example where we compute a wrong spill cost (2) without this patch, even though there is no call between any instruction in the bundle. This seems to have limited practical impact, .e.g on X86 with a recent Intel Xeon CPU with -O3 -march=native -flto on MultiSource,SPEC2000,SPEC2006 there are no binary changes. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D82444
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
0 files changed, 0 insertions, 0 deletions