Skip to content

Commit 3620ceb

Browse files
authored
Update CGBuiltin.cpp
1 parent 4460d21 commit 3620ceb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8390,6 +8390,15 @@ Value *CodeGenFunction::EmitARMBuiltinExpr(unsigned BuiltinID,
83908390
return Builder.CreateCall(F);
83918391
}
83928392

8393+
if (BuiltinID == AArch64::BI__prefetch) {
8394+
Value *Address = EmitScalarExpr(E->getArg(0));
8395+
Value *RW = llvm::ConstantInt::get(Int32Ty, 0);
8396+
Value *Locality = ConstantInt::get(Int32Ty, 3);
8397+
Value *Data = llvm::ConstantInt::get(Int32Ty, 1);
8398+
Function *F = CGM.getIntrinsic(Intrinsic::prefetch, Address->getType());
8399+
return Builder.CreateCall(F, {Address, RW, Locality, Data});
8400+
}
8401+
83938402
// Handle MSVC intrinsics before argument evaluation to prevent double
83948403
// evaluation.
83958404
if (std::optional<MSVCIntrin> MsvcIntId = translateArmToMsvcIntrin(BuiltinID))

0 commit comments

Comments
 (0)