[llvm] [InstSimplify] Simplify select if it combinated `and/or/xor` (PR #73362)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 8 23:45:59 PST 2024
================
@@ -4600,6 +4651,9 @@ static Value *simplifySelectWithICmpEq(Value *CmpLHS, Value *CmpRHS,
/* DropFlags */ nullptr, MaxRecurse) == FalseVal)
return FalseVal;
+ if (simplifySpecificBitOp(CmpLHS, CmpRHS, TrueVal, FalseVal))
+ return FalseVal;
----------------
dtcxzyw wrote:
```suggestion
if (Value *V = simplifySpecificBitOp(CmpLHS, CmpRHS, TrueVal, FalseVal))
return V;
```
It is unsafe since we may handle more patterns in the future...
https://github.com/llvm/llvm-project/pull/73362
More information about the llvm-commits
mailing list