================
@@ -2660,6 +2660,56 @@ static Value *EmitSpecialRegisterBuiltin(CodeGenFunction
&CGF,
return Builder.CreateCall(F, { Metadata, ArgValue });
}
+static Value *EmitRangePrefetchBuiltin(CodeGenFunction &CGF, unsigned
BuiltinID,
+ const CallExpr *E) {
+ CodeGen::CGBuilderTy &Builder = CGF.Builder;
+ CodeGen::CodeGenModule &CGM = CGF.CGM;
+ SmallVector<llvm::Value *, 4> Ops;
+
+ auto getIntArg = [&](unsigned ArgNo) {
+ Expr::EvalResult Result;
+ if (!E->getArg(ArgNo)->EvaluateAsInt(Result, CGM.getContext()))
+ llvm_unreachable("Expected constant argument to range prefetch.");
+ return Result.Val.getInt().getExtValue();
----------------
kmclaughlin-arm wrote:
Hi @shafik, I used `getExtValue()` because some of the arguments to the builtin
are signed (`Length` and `Stride`). I realise that given how the values are
used below that this doesn't change the result though, so I'm happy to change
this to `getZExtValue()` if that's preferred?
https://github.com/llvm/llvm-project/pull/170490
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits