From 23ce502cb7d9d06a1786d276a10be42e65759eca Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 25 Apr 2008 18:27:55 +0000 Subject: Remove the code from CodeGenPrepare that moved getresult instructions to the block that defines their operands. This doesn't work in the case that the operand is an invoke, because invoke is a terminator and must be the last instruction in a block. Replace it with support in SelectionDAGISel for copying struct values into sequences of virtual registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50279 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/CodeGenPrepare.cpp | 9 --------- 1 file changed, 9 deletions(-) (limited to 'lib/Transforms/Scalar/CodeGenPrepare.cpp') diff --git a/lib/Transforms/Scalar/CodeGenPrepare.cpp b/lib/Transforms/Scalar/CodeGenPrepare.cpp index 532af2511e..4be37a33cf 100644 --- a/lib/Transforms/Scalar/CodeGenPrepare.cpp +++ b/lib/Transforms/Scalar/CodeGenPrepare.cpp @@ -1127,15 +1127,6 @@ bool CodeGenPrepare::OptimizeBlock(BasicBlock &BB) { // Sink address computing for memory operands into the block. MadeChange |= OptimizeInlineAsmInst(I, &(*CI), SunkAddrs); } - } else if (GetResultInst *GRI = dyn_cast(I)) { - // Ensure that all getresult instructions live in the same basic block - // as their associated struct-value instructions. Codegen requires - // this, as lowering only works on one basic block at a time. - if (Instruction *Agg = dyn_cast(GRI->getAggregateValue())) { - BasicBlock *AggBB = Agg->getParent(); - if (AggBB != GRI->getParent()) - GRI->moveBefore(AggBB->getTerminator()); - } } } -- cgit v1.2.3-70-g09d2