diff options
author | Devang Patel <dpatel@apple.com> | 2007-09-21 21:18:19 +0000 |
---|---|---|
committer | Devang Patel <dpatel@apple.com> | 2007-09-21 21:18:19 +0000 |
commit | 058c67a070dea39e3c0282664f0e82b1346ae845 (patch) | |
tree | 9bb1e2acf1c2a37e54253c12f7493b94aef662d3 /lib | |
parent | 5e97a93ed67d82291720088f6aeab18247b9d1c6 (diff) | |
download | external_llvm-058c67a070dea39e3c0282664f0e82b1346ae845.zip external_llvm-058c67a070dea39e3c0282664f0e82b1346ae845.tar.gz external_llvm-058c67a070dea39e3c0282664f0e82b1346ae845.tar.bz2 |
Fix PR1692
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Transforms/Scalar/LoopIndexSplit.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/LoopIndexSplit.cpp b/lib/Transforms/Scalar/LoopIndexSplit.cpp index 9e2f11b..afb7339 100644 --- a/lib/Transforms/Scalar/LoopIndexSplit.cpp +++ b/lib/Transforms/Scalar/LoopIndexSplit.cpp @@ -1181,15 +1181,17 @@ void LoopIndexSplit::calculateLoopBounds(SplitInfo &SD) { // values in original loop's preheader. // A_ExitValue = min(SplitValue, OrignalLoopExitValue) // B_StartValue = max(SplitValue, OriginalLoopStartValue) + Instruction *InsertPt = L->getHeader()->getFirstNonPHI(); Value *C1 = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, AEV, ExitCondition->getOperand(ExitValueNum), - "lsplit.ev", PHTerminator); + "lsplit.ev", InsertPt); + SD.A_ExitValue = new SelectInst(C1, AEV, ExitCondition->getOperand(ExitValueNum), - "lsplit.ev", PHTerminator); - + "lsplit.ev", InsertPt); + Value *C2 = new ICmpInst(Sign ? ICmpInst::ICMP_SLT : ICmpInst::ICMP_ULT, BSV, StartValue, "lsplit.sv", |