[clang] Fix cir vec cmp fold (PR #202502)

Andy Kaylor via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 9 14:55:46 PDT 2026


================
@@ -3509,7 +3535,9 @@ OpFoldResult cir::VecCmpOp::fold(FoldAdaptor adaptor) {
     }
     }
 
-    elements[i] = cir::IntAttr::get(getType().getElementType(), cmpResult);
+    // Vector comparison results are 0 (false) or -1 / all-ones (true).
----------------
andykaylor wrote:

This isn't quite right. A VecCmpOp can also be created that returns a vector of signed i1. Technically, I guess the true case there is -1 as an i1, but it's used differently in that case.

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


More information about the cfe-commits mailing list