aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/TwoAddressInstructionPass.cpp
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-18 23:10:20 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-06-18 23:10:20 +0000
commitfe181f4848a8c774155b8d853c2f53f7e7679872 (patch)
tree1c4faaf799c639b3af3eeff412ee2cf01520cdcb /lib/CodeGen/TwoAddressInstructionPass.cpp
parent86050dc8cc0aaea8c9dfeb89de02cafbd7f48d92 (diff)
Only run CoalesceExtSubRegs when we can expect LiveIntervalAnalysis to clean up
the inserted INSERT_SUBREGs after us. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106345 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/TwoAddressInstructionPass.cpp')
-rw-r--r--lib/CodeGen/TwoAddressInstructionPass.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp
index 048b6698a7..14102d1f3d 100644
--- a/lib/CodeGen/TwoAddressInstructionPass.cpp
+++ b/lib/CodeGen/TwoAddressInstructionPass.cpp
@@ -1397,8 +1397,11 @@ bool TwoAddressInstructionPass::EliminateRegSequences() {
MI->eraseFromParent();
}
- // Try coalescing some EXTRACT_SUBREG instructions.
- CoalesceExtSubRegs(RealSrcs, DstReg);
+ // Try coalescing some EXTRACT_SUBREG instructions. This can create
+ // INSERT_SUBREG instructions that must have <undef> flags added by
+ // LiveIntervalAnalysis, so only run it when LiveVariables is available.
+ if (LV)
+ CoalesceExtSubRegs(RealSrcs, DstReg);
}
RegSequences.clear();