From: Jakob Stoklund Olesen Date: Fri, 18 Jun 2010 23:10:20 +0000 (+0000) Subject: Only run CoalesceExtSubRegs when we can expect LiveIntervalAnalysis to clean up X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=fe181f4848a8c774155b8d853c2f53f7e7679872;p=oota-llvm.git 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 --- diff --git a/lib/CodeGen/TwoAddressInstructionPass.cpp b/lib/CodeGen/TwoAddressInstructionPass.cpp index 048b6698a73..14102d1f3dd 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 flags added by + // LiveIntervalAnalysis, so only run it when LiveVariables is available. + if (LV) + CoalesceExtSubRegs(RealSrcs, DstReg); } RegSequences.clear();