aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Scalar/LoopRotation.cpp
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2016-06-24 22:52:39 +0000
committerNico Weber <nicolasweber@gmx.de>2016-06-24 22:52:39 +0000
commitae2ef4ccd4b904461009c4444e1ae9006a666c0e (patch)
tree5e15cef9fa969476d81a31a2f81bd5f1c3371177 /llvm/lib/Transforms/Scalar/LoopRotation.cpp
parentbabc13a3e25636bd6b9ee64baf42bca1a8e497cf (diff)
downloadllvm-ae2ef4ccd4b904461009c4444e1ae9006a666c0e.zip
llvm-ae2ef4ccd4b904461009c4444e1ae9006a666c0e.tar.gz
llvm-ae2ef4ccd4b904461009c4444e1ae9006a666c0e.tar.bz2
Revert r273711, it caused PR28298.
llvm-svn: 273743
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r--llvm/lib/Transforms/Scalar/LoopRotation.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
index 46db8f1..c6709d5 100644
--- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp
+++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp
@@ -312,18 +312,13 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
if (V && LI->replacementPreservesLCSSAForm(C, V)) {
// If so, then delete the temporary instruction and stick the folded value
// in the map.
+ delete C;
ValueMap[Inst] = V;
- if (!C->mayHaveSideEffects()) {
- delete C;
- C = nullptr;
- }
} else {
- ValueMap[Inst] = C;
- }
- if (C) {
// Otherwise, stick the new instruction into the new block!
C->setName(Inst->getName());
C->insertBefore(LoopEntryBranch);
+ ValueMap[Inst] = C;
}
}