[llvm] [SystemZ] Fold i16/i32/i64 logical RMW operations into memory operands in TableGen (PR #192802)

Ulrich Weigand via llvm-commits llvm-commits at lists.llvm.org
Thu May 7 02:03:13 PDT 2026


================
@@ -35,6 +117,39 @@ define void @f3(ptr %ptr) {
   ret void
 }
 
+; Check the lowest useful constant for i16, expressed as an unsigned integer.
+define void @f3_i16(ptr %ptr) {
+; CHECK-LABEL: f3_i16:
+; CHECK: ni 1(%r2), 1
+; CHECK: br %r14
+  %val = load i16, ptr %ptr
+  %and = and i16 %val, 1
+  store i16 %and, ptr %ptr
----------------
uweigand wrote:

This is wrong - the `and` with 1 should clear the high byte.  See above.

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


More information about the llvm-commits mailing list