From 351b891cbc06f9e35d0675c132092ff5fb3f3ee2 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 2 Aug 2005 03:31:14 +0000 Subject: Like the comment says, do not insert cast instructions before phi nodes llvm-svn: 22586 --- llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp index fcb7ad3dfde..33714a2ad20 100644 --- a/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -232,6 +232,10 @@ void LoopStrengthReduce::AnalyzeGetElementPtrUsers(GetElementPtrInst *GEP, else ++InsertPt; } + + // Do not insert casts into the middle of PHI node blocks. + while (isa(InsertPt)) ++InsertPt; + BP = new CastInst(GEP->getOperand(0), UIntPtrTy, GEP->getOperand(0)->getName(), InsertPt); } -- cgit v1.2.3