[all-commits] [llvm/llvm-project] 8fda5b: [InstCombine] Add tests for folding `(icmp eq/ne (...
goldsteinn via All-commits
all-commits at lists.llvm.org
Mon Aug 5 08:49:26 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8fda5ba0ce0f4fd2854c2b0daec0c6c1fbe44e4e
https://github.com/llvm/llvm-project/commit/8fda5ba0ce0f4fd2854c2b0daec0c6c1fbe44e4e
Author: Noah Goldstein <goldstein.w.n at gmail.com>
Date: 2024-08-05 (Mon, 05 Aug 2024)
Changed paths:
A llvm/test/Transforms/InstCombine/icmp-or-of-select-with-zero.ll
Log Message:
-----------
[InstCombine] Add tests for folding `(icmp eq/ne (or (select cond, 0/NZ, 0/NZ), X), 0)`; NFC
Commit: b4ac7f4fc91ee5c8a192bcf15fffa69cb30d1912
https://github.com/llvm/llvm-project/commit/b4ac7f4fc91ee5c8a192bcf15fffa69cb30d1912
Author: Noah Goldstein <goldstein.w.n at gmail.com>
Date: 2024-08-05 (Mon, 05 Aug 2024)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
M llvm/test/Transforms/InstCombine/icmp-or-of-select-with-zero.ll
Log Message:
-----------
[InstCombine] Fold `(icmp eq/ne (or (select cond, 0/NZ, 0/NZ), X), 0)`
Four cases:
`(icmp eq (or (select cond, 0, NonZero), Other))`
-> `(and cond, (icmp eq Other, 0))`
`(icmp ne (or (select cond, NonZero, 0), Other))`
-> `(or cond, (icmp ne Other, 0))`
`(icmp ne (or (select cond, 0, NonZero), Other))`
-> `(or (not cond), (icmp ne Other, 0))`
`(icmp eq (or (select cond, NonZero, 0), Other))`
-> `(and (not cond), (icmp eq Other, 0))`
These cases came up in tests on: #88088
Proofs: https://alive2.llvm.org/ce/z/ojGo_J
Closes #88183
Compare: https://github.com/llvm/llvm-project/compare/d77f07d16661...b4ac7f4fc91e
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list