[llvm-commits] [llvm] r146751 - /llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Fri Dec 16 11:10:01 PST 2011
Author: stoklund
Date: Fri Dec 16 13:10:00 2011
New Revision: 146751
URL: http://llvm.org/viewvc/llvm-project?rev=146751&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp?rev=146751&r1=146750&r2=146751&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMConstantIslandPass.cpp Fri Dec 16 13:10:00 2011
@@ -934,23 +934,8 @@
// 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.
More information about the llvm-commits
mailing list