summaryrefslogtreecommitdiffstats
path: root/clang/lib/Basic/OperatorPrecedence.cpp
diff options
context:
space:
mode:
authorGuozhi Wei <carrot@google.com>2019-03-06 18:22:22 +0000
committerGuozhi Wei <carrot@google.com>2019-03-06 18:22:22 +0000
commit11308bdb433e1ebd759fb4a509f9a8002bea1e92 (patch)
tree0d7ca3baa64e95a263f3640bbb6385f222d62f87 /clang/lib/Basic/OperatorPrecedence.cpp
parenta89ce43cec5ee6aa621173a5cba716d7d734ddd1 (diff)
downloadbcm5719-llvm-11308bdb433e1ebd759fb4a509f9a8002bea1e92.tar.gz
bcm5719-llvm-11308bdb433e1ebd759fb4a509f9a8002bea1e92.zip
[PPC] Adjust the computed branch offset for the possible shorter distance
In file PPCBranchSelector.cpp we tend to over estimate code size due to large alignment and inline assembly. Usually it causes larger computed branch offset, it is not big problem. But sometimes it may also causes smaller computed branch offset than actual branch offset. If the offset is close to the limit of encoding, it may cause problem at run time. Following is a simplified example. actual estimated address address ... bne Far 100 10c .p2align 4 Near: 110 110 ... Far: 8108 8108 Actual offset: 0x8108 - 0x100 = 0x8008 Computed offset: 0x8108 - 0x10c = 0x7ffc The computed offset is at most ((1 << alignment) - 4) bytes smaller than actual offset. So we add this number to the offset for safety. Differential Revision: https://reviews.llvm.org/D57718 llvm-svn: 355529
Diffstat (limited to 'clang/lib/Basic/OperatorPrecedence.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud