diff options
author | Andreas Jonson <andjo403@hotmail.com> | 2025-09-08 19:16:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-09-08 19:16:41 +0200 |
commit | e11f93e9fdacae6e7003b6d34b32007fd3fc081c (patch) | |
tree | a32721f98c8b17ed9e58688b6abd1b7bf4f34e06 /llvm/lib/Transforms/Utils/SimplifyCFG.cpp | |
parent | 879f40ab041b31fa73b9b25e4ec9e06e810bc767 (diff) | |
download | llvm-e11f93e9fdacae6e7003b6d34b32007fd3fc081c.zip llvm-e11f93e9fdacae6e7003b6d34b32007fd3fc081c.tar.gz llvm-e11f93e9fdacae6e7003b6d34b32007fd3fc081c.tar.bz2 |
[SimplifyCFG] Support not in chain of comparisons. (#156497)
Proof: https://alive2.llvm.org/ce/z/cpXuCb
Diffstat (limited to 'llvm/lib/Transforms/Utils/SimplifyCFG.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SimplifyCFG.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp index 86d4750..39edc4d 100644 --- a/llvm/lib/Transforms/Utils/SimplifyCFG.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyCFG.cpp @@ -612,6 +612,9 @@ private: /// If CompValue is already set, the function is expected to fail if a match /// is found but the value compared to is different. bool matchInstruction(Instruction *I, bool isEQ) { + if (match(I, m_Not(m_Instruction(I)))) + isEQ = !isEQ; + Value *Val; if (match(I, m_NUWTrunc(m_Value(Val)))) { // If we already have a value for the switch, it has to match! |