summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-08-02 03:31:14 +0000
committerChris Lattner <sabre@nondot.org>2005-08-02 03:31:14 +0000
commit351b891cbc06f9e35d0675c132092ff5fb3f3ee2 (patch)
treeb28470cea0e33bda8b4623630164ed4b582b09ae /llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp
parent9aafa06befea616f07d8e955660e0a7eb5425527 (diff)
downloadbcm5719-llvm-351b891cbc06f9e35d0675c132092ff5fb3f3ee2.tar.gz
bcm5719-llvm-351b891cbc06f9e35d0675c132092ff5fb3f3ee2.zip
Like the comment says, do not insert cast instructions before phi nodes
llvm-svn: 22586
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopStrengthReduce.cpp4
1 files changed, 4 insertions, 0 deletions
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<PHINode>(InsertPt)) ++InsertPt;
+
BP = new CastInst(GEP->getOperand(0), UIntPtrTy,
GEP->getOperand(0)->getName(), InsertPt);
}
OpenPOWER on IntegriCloud