llvm-6502/lib
Richard Sandiford 5f1c7e5eac Fix double renaming bug in stack coloring pass
The stack coloring pass renumbered frame indexes with a loop of the form:

  for each frame index FI
    for each instruction I that uses FI
      for each use of FI in I
        rename FI to FI'

This caused problems if an instruction used two frame indexes F0 and F1
and if F0 was renamed to F1 and F1 to F2.  The first time we visited the
instruction we changed F0 to F1, then we changed both F1s to F2.

In other words, the problem was that SSRefs recorded which instructions
used an FI, but not which MachineOperands and MachineMemOperands within
that instruction used it.

This is easily fixed for MachineOperands by walking the instructions
once and processing each operand in turn.  There's already a loop to
do that for dead store elimination, so it seemed more efficient to
fuse the two at the block level.

MachineMemOperands are more tricky because they can be shared between
instructions.  The patch handles them by making SSRefs an array of
MachineMemOperands rather than an array of MachineInstrs.  We might end
up processing the same MachineMemOperand twice, but that's OK because
we always know from the SSRefs index what the original frame index was.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185703 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-05 14:24:47 +00:00
..
Analysis Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. 2013-07-04 01:31:24 +00:00
AsmParser Added support for the Builtin attribute. 2013-06-27 00:25:01 +00:00
Bitcode Remove the Copied parameter from MemoryObject::readBytes. 2013-05-24 10:54:58 +00:00
CodeGen Fix double renaming bug in stack coloring pass 2013-07-05 14:24:47 +00:00
DebugInfo Spell correct (s/begining/beginning/) 2013-06-19 21:42:05 +00:00
ExecutionEngine Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. 2013-07-04 01:31:24 +00:00
IR DebugInfo: Consider global variables without locations to be valid 2013-07-04 23:15:18 +00:00
IRReader keep only the StringRef version of getFileOrSTDIN. 2013-06-25 05:28:34 +00:00
Linker Extend RemapInstruction and friends to take an optional new parameter, a ValueMaterializer. 2013-05-28 15:17:05 +00:00
MC Remove use of asymmetric std::lower_bound comparator. 2013-07-04 23:20:12 +00:00
Object Use the raw member names in Archive::Archive. 2013-07-05 03:35:15 +00:00
Option Fix a crash bug in dumping options with groups 2013-06-26 22:43:37 +00:00
Support Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. 2013-07-04 01:31:24 +00:00
TableGen keep only the StringRef version of getFileOrSTDIN. 2013-06-25 05:28:34 +00:00
Target [SystemZ] Enable the use of MVC for frame-to-frame spills 2013-07-05 14:02:01 +00:00
Transforms InstCombine: (icmp eq B, 0) | (icmp ult A, B) -> (icmp ule A, B-1) 2013-07-05 00:31:17 +00:00
CMakeLists.txt Move lib/Archive to tools/llvm-ar. 2013-06-17 15:47:20 +00:00
LLVMBuild.txt Move lib/Archive to tools/llvm-ar. 2013-06-17 15:47:20 +00:00
Makefile Move lib/Archive to tools/llvm-ar. 2013-06-17 15:47:20 +00:00