diff options
author | Jay Foad <jay.foad@amd.com> | 2022-01-31 14:55:36 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@amd.com> | 2022-01-31 14:55:36 +0000 |
commit | 8faad296347a2c6d0567f28b307bfc40acc26e07 (patch) | |
tree | 7ca33eb5fd7731b06ed3e035886d41fbd9fc8d58 /llvm/lib/Transforms/Utils/Local.cpp | |
parent | 002b944dfa3d588b05f967d6b55e6c36ce97d4e5 (diff) | |
download | llvm-8faad296347a2c6d0567f28b307bfc40acc26e07.zip llvm-8faad296347a2c6d0567f28b307bfc40acc26e07.tar.gz llvm-8faad296347a2c6d0567f28b307bfc40acc26e07.tar.bz2 |
Revert "[Local] invertCondition: try modifying an existing ICmpInst"
This reverts commit a6b54ddaba2d5dc0f72dcc4591c92b9544eb0016.
Apparently it is not safe to modify the condition even if it passes the
hasOneUse test, because StructurizeCFG might have other references to
the condition that are not manifest in the IR use-def chains.
Diffstat (limited to 'llvm/lib/Transforms/Utils/Local.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/Local.cpp | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp index c457931..9f33d2f 100644 --- a/llvm/lib/Transforms/Utils/Local.cpp +++ b/llvm/lib/Transforms/Utils/Local.cpp @@ -3343,14 +3343,6 @@ Value *llvm::invertCondition(Value *Condition) { if (I->getParent() == Parent && match(I, m_Not(m_Specific(Condition)))) return I; - // Fourth: Modify an existing instruction - if (Condition->hasOneUse()) { - if (auto *CI = dyn_cast<CmpInst>(Condition)) { - CI->setPredicate(CI->getInversePredicate()); - return Condition; - } - } - // Last option: Create a new instruction auto *Inverted = BinaryOperator::CreateNot(Condition, Condition->getName() + ".inv"); |