summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SimplifyCFG.cpp
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2016-09-07 07:36:11 +0000
committerHal Finkel <hfinkel@anl.gov>2016-09-07 07:36:11 +0000
commit42c83f131eff4046ba166b88959ae29ebce0c925 (patch)
treedb21204f5125f13d6672129e1561a927c5366155 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp
parentdb741e7203b9246816bc911e3e5fa7b19ffc0c14 (diff)
downloadbcm5719-llvm-42c83f131eff4046ba166b88959ae29ebce0c925.tar.gz
bcm5719-llvm-42c83f131eff4046ba166b88959ae29ebce0c925.zip
[PowerPC] Fix address-offset folding for plain addi
When folding an addi into a memory access that can take an immediate offset, we were implicitly assuming that the existing offset was zero. This was incorrect. If we're dealing with an addi with a plain constant, we can add it to the existing offset (assuming that doesn't overflow the immediate, etc.), but if we have anything else (i.e. something that will become a relocation expression), we'll go back to requiring the existing immediate offset to be zero (because we don't know what the requirements on that relocation expression might be - e.g. maybe it is paired with some addis in some relevant way). On the other hand, when dealing with a plain addi with a regular constant immediate, the alignment restrictions (from the TOC base pointer, etc.) are irrelevant. I've added the test case from PR30280, which demonstrated the bug, but also demonstrates a missed optimization opportunity (i.e. we don't need the memory accesses at all). Fixes PR30280. llvm-svn: 280789
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud