[clang] [llvm] [IR] Mark vector intrinsics speculatable (PR #162334)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 8 08:27:52 PDT 2025
================
@@ -10,30 +10,30 @@
// CHECK-C-SAME: i32 noundef [[SLICE_BASE:%.*]], <vscale x 16 x i1> [[PG:%.*]], ptr noundef [[PTR:%.*]], i64 noundef [[VNUM:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] {
// CHECK-C-NEXT: entry:
// CHECK-C-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.vscale.i64()
-// CHECK-C-NEXT: [[TMP1:%.*]] = shl i64 [[VNUM]], 4
-// CHECK-C-NEXT: [[MULVL:%.*]] = mul i64 [[TMP1]], [[TMP0]]
-// CHECK-C-NEXT: [[TMP2:%.*]] = getelementptr i8, ptr [[PTR]], i64 [[MULVL]]
-// CHECK-C-NEXT: [[TMP3:%.*]] = trunc i64 [[VNUM]] to i32
-// CHECK-C-NEXT: [[TMP4:%.*]] = add i32 [[SLICE_BASE]], [[TMP3]]
-// CHECK-C-NEXT: tail call void @llvm.aarch64.sme.ld1b.horiz(<vscale x 16 x i1> [[PG]], ptr [[TMP2]], i32 0, i32 [[TMP4]])
-// CHECK-C-NEXT: [[ADD:%.*]] = add i32 [[SLICE_BASE]], [[TMP3]]
-// CHECK-C-NEXT: [[TMP5:%.*]] = add i32 [[ADD]], 15
-// CHECK-C-NEXT: tail call void @llvm.aarch64.sme.ld1b.horiz(<vscale x 16 x i1> [[PG]], ptr [[TMP2]], i32 0, i32 [[TMP5]])
+// CHECK-C-NEXT: [[SVL:%.*]] = shl nuw nsw i64 [[TMP0]], 4
----------------
paulwalker-arm wrote:
Looking at the variable names I wonder if it's a case of no longer loosing the wrap flags rather than gaining them? From `CodeGenFunction::EmitSMELd1St1`:
```
llvm::Value *StreamingVectorLengthCall =
Builder.CreateMul(Builder.CreateCall(StreamingVectorLength),
llvm::ConstantInt::get(Int64Ty, 8), "svl",
/* HasNUW */ true, /* HasNSW */ true);
llvm::Value *Mulvl =
Builder.CreateMul(StreamingVectorLengthCall, Ops[4], "mulvl");
```
https://github.com/llvm/llvm-project/pull/162334
More information about the llvm-commits
mailing list