- Dec 12, 2011
-
-
Pete Cooper authored
If we create new intervals for a variable that is being spilled, then those new intervals are not guaranteed to also spill. This means that anything reading from the original spilling value might not get the correct value if spills were missed. Fixes <rdar://problem/10546864> llvm-svn: 146428
-
- Dec 07, 2011
-
-
Evan Cheng authored
generator to it. For non-bundle instructions, these behave exactly the same as the MC layer API. For properties like mayLoad / mayStore, look into the bundle and if any of the bundled instructions has the property it would return true. For properties like isPredicable, only return true if *all* of the bundled instructions have the property. For properties like canFoldAsLoad, isCompare, conservatively return false for bundles. llvm-svn: 146026
-
- Nov 14, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 144517
-
- Nov 13, 2011
-
-
Jakob Stoklund Olesen authored
This makes no difference for normal defs, but early clobber dead defs now look like: [Slot_EarlyClobber; Slot_Dead) instead of: [Slot_EarlyClobber; Slot_Register). Live ranges for normal dead defs look like: [Slot_Register; Slot_Dead) as before. llvm-svn: 144512
-
Jakob Stoklund Olesen authored
The old naming scheme (load/use/def/store) can be traced back to an old linear scan article, but the names don't match how slots are actually used. The load and store slots are not needed after the deferred spill code insertion framework was deleted. The use and def slots don't make any sense because we are using half-open intervals as is customary in C code, but the names suggest closed intervals. In reality, these slots were used to distinguish early-clobber defs from normal defs. The new naming scheme also has 4 slots, but the names match how the slots are really used. This is a purely mechanical renaming, but some of the code makes a lot more sense now. llvm-svn: 144503
-
Jakob Stoklund Olesen authored
Nobody cared, StackSlotColoring scans the instructions to find used stack slots. llvm-svn: 144485
-
- Nov 10, 2011
-
-
Jakob Stoklund Olesen authored
The TII.foldMemoryOperand hook preserves implicit operands from the original instruction. This is not what we want when those implicit operands refer to the register being spilled. Implicit operands referring to other registers are preserved. This fixes PR11347. llvm-svn: 144247
-
- Oct 14, 2011
-
-
Jakob Stoklund Olesen authored
When spilling around an instruction with a dead def, remember to add a value number for the def. The missing value number wouldn't normally create problems since there would be an incoming live range as well. However, due to another bug we could spill a dead V_SET0 instruction which doesn't read any values. The missing value number caused an empty live range to be created which is dangerous since it doesn't interfere with anything. This fixes part of PR11125. llvm-svn: 141923
-
- Sep 16, 2011
-
-
Jakob Stoklund Olesen authored
If the source register is live after the copy being spilled, there is no point to hoisting it. Hoisting inside a basic block only serves to resolve interferences by shortening the live range of the source. llvm-svn: 139882
-
- Sep 15, 2011
-
-
Jakob Stoklund Olesen authored
When -split-spill-mode is enabled, spill hoisting is performed by SplitKit instead of by InlineSpiller. This hidden command line option is for testing the splitter spill mode. llvm-svn: 139845
-
Jakob Stoklund Olesen authored
The number of spills could go negative since a folded COPY is just a spill, and it may be eliminated. llvm-svn: 139815
-
Jakob Stoklund Olesen authored
Adjust counters when removing spill and reload instructions. We still don't account for reloads being removed by eliminateDeadDefs(). llvm-svn: 139806
-
Jakob Stoklund Olesen authored
When traceSiblingValue() encounters a PHI-def value created by live range splitting, don't look at all the predecessor blocks. That can be very expensive in a complicated CFG. Instead, consider that all the non-PHI defs jointly dominate all the PHI-defs. Tracing directly to all the non-PHI defs is much faster that zipping around in the CFG when there are many PHIs with many predecessors. This significantly improves compile time for indirectbr interpreters. llvm-svn: 139797
-
- Sep 09, 2011
-
-
Jakob Stoklund Olesen authored
In some cases such as interpreters using indirectbr, the CFG can be very complicated, and live range splitting may be forced to insert a large number of phi-defs. When that happens, traceSiblingValue can spend a lot of time zipping around in the CFG looking for defs and reloads. This patch causes more information to be cached in SibValues, and the cached values are used to terminate searches early. This speeds up spilling by 20x in one interpreter test case. For more typical code, this is just a 10% speedup of spilling. The previous version had bugs that caused miscompilations. They have been fixed. llvm-svn: 139378
-
- Sep 07, 2011
-
-
Jakob Stoklund Olesen authored
It broke the self host and clang-x86_64-darwin10-RA. llvm-svn: 139259
-
Jakob Stoklund Olesen authored
In some cases such as interpreters using indirectbr, the CFG can be very complicated, and live range splitting may be forced to insert a large number of phi-defs. When that happens, traceSiblingValue can spend a lot of time zipping around in the CFG looking for defs and reloads. This patch causes more information to be cached in SibValues, and the cached values are used to terminate searches early. This speeds up spilling by 20x in one interpreter test case. For more typical code, this is just a 10% speedup of spilling. llvm-svn: 139247
-
- Sep 01, 2011
-
-
Jakob Stoklund Olesen authored
The problem is fixed for all register allocators by r138944, so this patch is no longer necessary. <rdar://problem/10032939> llvm-svn: 138945
-
- Aug 30, 2011
-
-
Bob Wilson authored
I don't currently have a good testcase for this; will try to get one tomorrow. <rdar://problem/10032939> llvm-svn: 138794
-
- Jul 18, 2011
-
-
Jakob Stoklund Olesen authored
When trying to rematerialize a value before an instruction that has an early-clobber redefine of the virtual register, make sure to look up the correct value number. Early-clobber defs are moved one slot back, so getBaseIndex is needed to find the used value number. Bugpoint was unable to reduce the test case for this, see PR10388. llvm-svn: 135378
-
- Jul 09, 2011
-
-
Jakob Stoklund Olesen authored
Spills should be hoisted out of loops, but we don't want to hoist them to dominating blocks at the same loop depth. That could cause the spills to be executed more often. llvm-svn: 134782
-
Jakob Stoklund Olesen authored
Try to move spills as early as possible in their basic block. This can help eliminate interferences by shortening the live range being spilled. This fixes PR10221. llvm-svn: 134776
-
- Jul 05, 2011
-
-
Jakob Stoklund Olesen authored
Remat during spilling triggers dead code elimination. If a phi-def becomes unused, that may also cause live ranges to split into separate connected components. This type of splitting is different from normal live range splitting. In particular, there may not be a common original interval. When the split range is its own original, make sure that the new siblings are also their own originals. The range being split cannot be used as an original since it doesn't cover the new siblings. llvm-svn: 134413
-
- Jun 30, 2011
-
-
Rafael Espindola authored
llvm-svn: 134189
-
- May 11, 2011
-
-
Jakob Stoklund Olesen authored
about to be spilled. This can only happen when two extra snippet registers are included in the spill, and there is a copy between them. Hoisting the spill creates problems because the hoist will mark the copy for later dead code elimination, and spilling the second register will turn the copy into a spill. <rdar://problem/9420853> llvm-svn: 131192
-
- May 05, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 130931
-
- Apr 30, 2011
-
-
Jakob Stoklund Olesen authored
This could happen when trying to use a value that had been eliminated after dead code elimination and folding loads. llvm-svn: 130597
-
- Apr 21, 2011
-
-
Jakob Stoklund Olesen authored
llvm-svn: 129883
-
- Apr 18, 2011
-
-
Jakob Stoklund Olesen authored
the spilled register. This is quite common on ARM now that some stores have early-clobber defines. llvm-svn: 129714
-
- Mar 31, 2011
-
-
Jakob Stoklund Olesen authored
The rematerialized instruction may require a more constrained register class than the register being spilled. In the test case, the spilled register has been inflated to the DPR register class, but we are rematerializing a load of the ssub_0 sub-register which only exists for DPR_VFP2 registers. The register class is reinflated after spilling, so the conservative choice is only temporary. llvm-svn: 128610
-
- Mar 29, 2011
-
-
Jakob Stoklund Olesen authored
The spill weight is not recomputed for an unspillable register - it stays infinite. llvm-svn: 128490
-
Jakob Stoklund Olesen authored
llvm-svn: 128469
-
Jakob Stoklund Olesen authored
This may eliminate some uses of the spilled registers, and we don't want to insert reloads for that. llvm-svn: 128468
-
Jakob Stoklund Olesen authored
The instruction to be rematerialized may not be the one defining the register that is being spilled. The traceSiblingValue() function sees through sibling copies to find the remat candidate. llvm-svn: 128449
-
- Mar 26, 2011
-
-
Jakob Stoklund Olesen authored
The main register class may have been inflated by live range splitting, so that register class is not necessarily valid for the snippet instructions. Use the original register class for the stack slot interval. llvm-svn: 128351
-
- Mar 20, 2011
-
-
Jakob Stoklund Olesen authored
This can happen when multiple sibling registers are spilled after live range splitting. llvm-svn: 127965
-
Jakob Stoklund Olesen authored
llvm-svn: 127964
-
Jakob Stoklund Olesen authored
llvm-svn: 127959
-
- Mar 18, 2011
-
-
Jakob Stoklund Olesen authored
Stack slot real estate is virtually free compared to registers, so it is advantageous to spill earlier even though the same value is now kept in both a register and a stack slot. Also eliminate redundant spills by extending the stack slot live range underneath reloaded registers. This can trigger a dead code elimination, removing copies and even reloads that were only feeding spills. llvm-svn: 127868
-
- Mar 17, 2011
-
-
Jakob Stoklund Olesen authored
I have convinced myself that it can only happen when a phi value dies. When it happens, allocate new virtual registers for the components. llvm-svn: 127827
-
- Mar 15, 2011
-
-
Jakob Stoklund Olesen authored
After live range splitting, an original value may be available in multiple registers. Tracing back through the registers containing the same value, find the best place to insert a spill, determine if the value has already been spilled, or discover a reaching def that may be rematerialized. This is only the analysis part. The information is not used for anything yet. llvm-svn: 127698
-