diff options
author | David Majnemer <david.majnemer@gmail.com> | 2016-06-25 00:04:10 +0000 |
---|---|---|
committer | David Majnemer <david.majnemer@gmail.com> | 2016-06-25 00:04:10 +0000 |
commit | b8da3a2bb2b840db6ab7c473190ee6d65dcf3a1e (patch) | |
tree | 1f31a99143afe03689b792363a1f4f857a55a415 /llvm/lib/Transforms/Scalar/LoopRotation.cpp | |
parent | 580e7543481d0513d8eda2eb8c9735825b68dc02 (diff) | |
download | llvm-b8da3a2bb2b840db6ab7c473190ee6d65dcf3a1e.zip llvm-b8da3a2bb2b840db6ab7c473190ee6d65dcf3a1e.tar.gz llvm-b8da3a2bb2b840db6ab7c473190ee6d65dcf3a1e.tar.bz2 |
Reinstate r273711
r273711 was reverted by r273743. The inliner needs to know about any
call sites in the inlined function. These were obscured if we replaced
a call to undef with an undef but kept the call around.
This fixes PR28298.
llvm-svn: 273753
Diffstat (limited to 'llvm/lib/Transforms/Scalar/LoopRotation.cpp')
-rw-r--r-- | llvm/lib/Transforms/Scalar/LoopRotation.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/LoopRotation.cpp b/llvm/lib/Transforms/Scalar/LoopRotation.cpp index c6709d5..46db8f1 100644 --- a/llvm/lib/Transforms/Scalar/LoopRotation.cpp +++ b/llvm/lib/Transforms/Scalar/LoopRotation.cpp @@ -312,13 +312,18 @@ 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; } } |