================
@@ -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).
----------------
iamaayushrivastava wrote:

You're right that for `!cir.int<s, 1>` results, -1 and 1 are the same bit 
pattern (all-ones at width 1). Added a comment clarifying that for 1-bit 
element types, -1 and 0 are still the correct true/false bit patterns, since -1 
and 1 have the same representation at width 1. Thank you for the suggestion.

https://github.com/llvm/llvm-project/pull/202502
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to