[Mlir-commits] [mlir] [MLIR][Arith] SelectOp fix invalid folding (PR #117555)

Jakub Kuderski llvmlistbot at llvm.org
Mon Nov 25 06:53:50 PST 2024


================
@@ -2314,7 +2314,8 @@ OpFoldResult arith::SelectOp::fold(FoldAdaptor adaptor) {
     return trueVal;
 
   // select %x, true, false => %x
-  if (getType().isInteger(1) && matchPattern(adaptor.getTrueValue(), m_One()) &&
+  if (getType().isSignlessInteger(1) &&
----------------
kuhar wrote:

Instead, should we compare the operand type to the condition type? I think this could also apply to unsigned/signed integers, no?

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


More information about the Mlir-commits mailing list