C ? (Y != X) : (Z != X) --> (C ? Y : Z) != X
C ? (Y == X) : (Z == X) --> (C ? Y : Z) == X
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Nice!
But we can handle any pair of matching predicates (in follow-up patches is fine)? We just need to make sure the common operand is in the right position for non-commutative predicates:
https://alive2.llvm.org/ce/z/xgx4eh
Comment Actions
Please pre-commit baseline tests.
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp | ||
---|---|---|
387–388 | Can shorten this: if (TPred == FPred && ICmpInst::isEquality(TPred)) |
Can shorten this: