[llvm] [InstSimplify] Move Select with bittest folds. NFC. (PR #122944)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 14 23:43:14 PST 2025


================
@@ -4612,14 +4612,16 @@ static Value *simplifyCmpSelOfMaxMin(Value *CmpLHS, Value *CmpRHS,
   return nullptr;
 }
 
-/// An alternative way to test if a bit is set or not uses sgt/slt instead of
-/// eq/ne.
-static Value *simplifySelectWithFakeICmpEq(Value *CmpLHS, Value *CmpRHS,
-                                           CmpPredicate Pred, Value *TrueVal,
-                                           Value *FalseVal) {
-  if (auto Res = decomposeBitTestICmp(CmpLHS, CmpRHS, Pred))
-    return simplifySelectBitTest(TrueVal, FalseVal, Res->X, &Res->Mask,
-                                 Res->Pred == ICmpInst::ICMP_EQ);
+/// An alternative way to test if a bit is set or not uses e.g. sgt/slt instead
+/// of eq/ne.
+static Value *simplifySelectWithBitTest(Value *CondVal, Value *TrueVal,
+                                        Value *FalseVal) {
+
----------------
dtcxzyw wrote:

```suggestion
```

https://github.com/llvm/llvm-project/pull/122944


More information about the llvm-commits mailing list