- Oct 15, 2009
-
-
Bob Wilson authored
In the case where there are no good places to put constants and we fall back upon inserting unconditional branches to make new blocks, allow all constant pool references in range of those blocks to put constants there, even if that means resetting the "high water marks" for those references. This will still terminate because you can't keep splitting blocks forever, and in the bad cases where we have to split blocks, it is important to avoid splitting more than necessary. llvm-svn: 84202
-
Bob Wilson authored
llvm-svn: 84173
-
Bob Wilson authored
When ARMConstantIslandPass cannot find any good locations (i.e., "water") to place constants, it falls back to inserting unconditional branches to make a place to put them. My recent change exposed a problem in this area. We may sometimes append to the same block more than one unconditional branch. The symptoms of this are that the generated assembly has a branch to an undefined label and running llc with -debug will cause a seg fault. This happens more easily since my change to prevent CPEs from moving from lower to higher addresses as the algorithm iterates, but it could have happened before. The end of the block may be in range for various constant pool references, but the insertion point for new CPEs is not right at the end of the block -- it is at the end of the CPEs that have already been placed at the end of the block. The insertion point could be out of range. When that happens, the fallback code will always append another unconditional branch if the end of the block is in range. The fix is to only append an unconditional branch if the block does not already end with one. I also removed a check to see if the constant pool load instruction is at the end of the block, since that is redundant with checking if the end of the block is in-range. There is more to be done here, but I think this fixes the immediate problem. llvm-svn: 84172
-
- Oct 13, 2009
-
-
Bob Wilson authored
llvm-svn: 83982
-
Bob Wilson authored
before its reference is only supported on ARM has not been true for a while. In fact, until recently, that was only supported for Thumb. Besides that, CPEs are always a multiple of 4 bytes in size, so inserting a CPE should have no effect on Thumb alignment. llvm-svn: 83916
-
- Oct 12, 2009
-
-
Bob Wilson authored
llvm-svn: 83905
-
Bob Wilson authored
MultiSource/Benchmarks/MiBench/automotive-susan test. The failure has since been masked by an unrelated change (just randomly), so I don't have a testcase for this now. Radar 7291928. The situation where this happened is that a constant pool entry (CPE) was placed at a lower address than the load that referenced it. There were in fact 2 CPEs placed at adjacent addresses and referenced by 2 loads that were close together in the code. The distance from the loads to the CPEs was right at the limit of what they could handle, so that only one of the CPEs could be placed within range. On every iteration, the first CPE was found to be out of range, causing a new CPE to be inserted. The second CPE had been in range but the newly inserted entry pushed it too far away. Thus the second CPE was also replaced by a new entry, which in turn pushed the first CPE out of range. Etc. Judging from some comments in the code, the initial implementation of this pass did not support CPEs placed _before_ their references. In the case where the CPE is placed at a higher address, the key to making the algorithm terminate is that new CPEs are only inserted at the end of a group of adjacent CPEs. This is implemented by removing a basic block from the "WaterList" once it has been used, and then adding the newly inserted CPE block to the list so that the next insertion will come after it. This avoids the ping-pong effect where CPEs are repeatedly moved to the beginning of a group of adjacent CPEs. This does not work when going backwards, however, because the entries at the end of an adjacent group of CPEs are closer than the CPEs earlier in the group. To make this pass terminate, we need to maintain a property that changes can only happen in some sort of monotonic fashion. The fix used here is to require that the CPE for a particular constant pool load can only move to lower addresses. This is a very simple change to the code and should not cause any significant degradation in the results. llvm-svn: 83902
-
Bob Wilson authored
llvm-svn: 83897
-
Bob Wilson authored
llvm-svn: 83894
-
Bob Wilson authored
llvm-svn: 83874
-
Bob Wilson authored
llvm-svn: 83873
-
Bob Wilson authored
llvm-svn: 83872
-
- Oct 01, 2009
-
-
Evan Cheng authored
llvm-svn: 83214
-
- Aug 23, 2009
-
-
Chris Lattner authored
llvm-svn: 79833
-
Chris Lattner authored
MachineInstr and MachineOperand. This required eliminating a bunch of stuff that was using DOUT, I hope that bill doesn't mind me stealing his fun. ;-) llvm-svn: 79813
-
- Aug 14, 2009
-
-
Evan Cheng authored
llvm-svn: 79014
-
Evan Cheng authored
llvm-svn: 78970
-
- Aug 13, 2009
-
-
Evan Cheng authored
llvm-svn: 78898
-
- Aug 12, 2009
-
-
Evan Cheng authored
llvm-svn: 78779
-
- Aug 11, 2009
-
-
Evan Cheng authored
llvm-svn: 78717
-
Jim Grosbach authored
llvm-svn: 78666
-
Evan Cheng authored
llvm-svn: 78655
-
- Aug 07, 2009
-
-
Evan Cheng authored
llvm-svn: 78377
-
Evan Cheng authored
llvm-svn: 78370
-
- Aug 01, 2009
-
-
Evan Cheng authored
llvm-svn: 77781
-
- Jul 31, 2009
-
-
Evan Cheng authored
is scaled by two. - Teach GetInstSizeInBytes about TBB and TBH. llvm-svn: 77701
-
- Jul 30, 2009
-
-
Evan Cheng authored
llvm-svn: 77522
-
- Jul 29, 2009
-
-
Evan Cheng authored
llvm-svn: 77422
-
- Jul 25, 2009
-
-
Evan Cheng authored
Before: adr r12, #LJTI3_0_0 ldr pc, [r12, +r0, lsl #2] LJTI3_0_0: .long LBB3_24 .long LBB3_30 .long LBB3_31 .long LBB3_32 After: adr r12, #LJTI3_0_0 add pc, r12, +r0, lsl #2 LJTI3_0_0: b.w LBB3_24 b.w LBB3_30 b.w LBB3_31 b.w LBB3_32 This has several advantages. 1. This will make it easier to optimize this to a TBB / TBH instruction + (smaller) table. 2. This eliminate the need for ugly asm printer hack to force the address into thumb addresses (bit 0 is one). 3. Same codegen for pic and non-pic. 4. This eliminate the need to align the table so constantpool island pass won't have to over-estimate the size. Based on my calculation, the later is probably slightly faster as well since ldr pc with shifter address is very slow. That is, it should be a win as long as the HW implementation can do a reasonable job of branch predict the second branch. llvm-svn: 77024
-
- Jul 24, 2009
-
-
Evan Cheng authored
Disable my constant island pass optimization (to make use soimm more effectively). It caused infinite looping on lencod. llvm-svn: 76995
-
Evan Cheng authored
llvm-svn: 76986
-
- Jul 23, 2009
-
-
Evan Cheng authored
Also fixed up code to fully use the SoImm field for ADR on ARM mode. llvm-svn: 76890
-
- Jul 22, 2009
-
-
Evan Cheng authored
negative on an individual bases rather than basing on whether it's in thumb mode. llvm-svn: 76698
-
- Jul 14, 2009
-
-
Torok Edwin authored
This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
-
- Jul 11, 2009
-
-
Torok Edwin authored
Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
-
- Jul 09, 2009
-
-
David Goodwin authored
llvm-svn: 75067
-
- Jul 07, 2009
-
-
Evan Cheng authored
llvm-svn: 74888
-
- Jul 02, 2009
-
-
Bob Wilson authored
llvm-svn: 74658
-
- Jun 30, 2009
-
-
David Goodwin authored
llvm-svn: 74549
-
David Goodwin authored
llvm-svn: 74543
-