[llvm] [Vectorize] Vectorization for __builtin_prefetch (PR #66160)

Renato Golin via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 30 04:00:27 PST 2023


================
@@ -1563,6 +1563,15 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> {
       return thisT()->getGatherScatterOpCost(Instruction::Load, RetTy, Args[0],
                                              VarMask, Alignment, CostKind, I);
     }
+    case Intrinsic::masked_gather_prefetch: {
+      const Value *Mask = Args[4];
+      bool VarMask = !isa<Constant>(Mask);
+      Align Alignment = cast<ConstantInt>(Args[1])->getAlignValue();
----------------
rengolin wrote:

You're not checking if `Args[1]` is a `ConstantInt`, Is that guaranteed elsewhere?

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


More information about the llvm-commits mailing list