OSDN Git Service

[PowerPC] For larger offsets, when possible, fold offset into addis toc@ha
authorHal Finkel <hfinkel@anl.gov>
Fri, 2 Sep 2016 21:37:07 +0000 (21:37 +0000)
committerHal Finkel <hfinkel@anl.gov>
Fri, 2 Sep 2016 21:37:07 +0000 (21:37 +0000)
commitbcc57c0a399648342de5c33f7e97d8f47229a9ac
tree7101004b37ff237afdb8fdaa6d86b61bdcda16cb
parent5bcf84687dab4ac3710e8bed415cf8e15d26087b
[PowerPC] For larger offsets, when possible, fold offset into addis toc@ha

When we have an offset into a global, etc. that is accessed relative to the TOC
base pointer, and the offset is larger than the minimum alignment of the global
itself and the TOC base pointer (which is 8-byte aligned), we can still fold
the @toc@ha into the memory access, but we must update the addis instruction's
symbol reference with the offset as the symbol addend. When there is only one
use of the addi to be folded and only one use of the addis that would need its
symbol's offset adjusted, then we can make the adjustment and fold the @toc@l
into the memory access.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@280545 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
test/CodeGen/PowerPC/peephole-align.ll