diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-16 19:10:00 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2011-12-16 19:10:00 +0000 |
commit | f9aabb8f32d61d19f57fb4710c06d01a12fedce7 (patch) | |
tree | dd0d6fee39ccea9b9ffe66412814157a3344618d /lib | |
parent | 903456245bda41adc90dcab67623169ee3aaff8b (diff) |
Don't adjust for alignment padding in OffsetIsInRange.
This adjustment is already included in the block offsets computed by
BasicBlockInfo, and adjusting again here can cause the pass to loop.
When CreateNewWater splits a basic block, OffsetIsInRange would reject
the new CPE on the next pass because of the too conservative alignment
adjustment. This caused the block to be split again, and so on.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146751 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMConstantIslandPass.cpp | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/lib/Target/ARM/ARMConstantIslandPass.cpp b/lib/Target/ARM/ARMConstantIslandPass.cpp index fc85666855..7cdce3db16 100644 --- a/lib/Target/ARM/ARMConstantIslandPass.cpp +++ b/lib/Target/ARM/ARMConstantIslandPass.cpp @@ -934,23 +934,8 @@ bool ARMConstantIslands::OffsetIsInRange(unsigned UserOffset, // purposes of the displacement computation; compensate for that here. // Effectively, the valid range of displacements is 2 bytes smaller for such // references. - unsigned TotalAdj = 0; - if (isThumb && UserOffset%4 !=0) { + if (isThumb && UserOffset%4 !=0) UserOffset -= 2; - TotalAdj = 2; - } - // CPEs will be rounded up to a multiple of 4. - if (isThumb && TrialOffset%4 != 0) { - TrialOffset += 2; - TotalAdj += 2; - } - - // In Thumb2 mode, later branch adjustments can shift instructions up and - // cause alignment change. In the worst case scenario this can cause the - // user's effective address to be subtracted by 2 and the CPE's address to - // be plus 2. - if (isThumb2 && TotalAdj != 4) - MaxDisp -= (4 - TotalAdj); if (UserOffset <= TrialOffset) { // User before the Trial. |