@@ -18415,20 +18415,23 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned BuiltinID,
18415
18415
}
18416
18416
18417
18417
void CodeGenFunction::AddAMDGCNAddressSpaceMMRA(llvm::Instruction *Inst,
18418
- const CallExpr *E, unsigned FirstASNameIdx) {
18418
+ const CallExpr *E,
18419
+ unsigned FirstASNameIdx) {
18419
18420
constexpr const char *Tag = "opencl-fence-mem";
18420
18421
18421
18422
LLVMContext &Ctx = Inst->getContext();
18422
18423
SmallVector<MMRAMetadata::TagT, 3> MMRAs;
18423
- for(unsigned K = FirstASNameIdx; K < E->getNumArgs(); ++K) {
18424
+ for (unsigned K = FirstASNameIdx; K < E->getNumArgs(); ++K) {
18424
18425
llvm::Value *V = EmitScalarExpr(E->getArg(K));
18425
18426
StringRef AS;
18426
- if(llvm::getConstantStringInfo(V, AS) && (AS == "local" || AS == "global" || AS == "image")) {
18427
+ if (llvm::getConstantStringInfo(V, AS) &&
18428
+ (AS == "local" || AS == "global" || AS == "image")) {
18427
18429
MMRAs.push_back({Tag, AS});
18428
18430
// TODO: Delete the resulting unused constant?
18429
18431
continue;
18430
18432
}
18431
- CGM.Error(E->getExprLoc(), "expected one of \"local\", \"global\" or \"image\"");
18433
+ CGM.Error(E->getExprLoc(),
18434
+ "expected one of \"local\", \"global\" or \"image\"");
18432
18435
}
18433
18436
18434
18437
llvm::unique(MMRAs);
@@ -19107,7 +19110,8 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID,
19107
19110
ProcessOrderScopeAMDGCN(EmitScalarExpr(E->getArg(0)),
19108
19111
EmitScalarExpr(E->getArg(1)), AO, SSID);
19109
19112
FenceInst *Fence = Builder.CreateFence(AO, SSID);
19110
- if (BuiltinID == AMDGPU::BI__builtin_amdgcn_masked_fence && E->getNumArgs() > 2)
19113
+ if (BuiltinID == AMDGPU::BI__builtin_amdgcn_masked_fence &&
19114
+ E->getNumArgs() > 2)
19111
19115
AddAMDGCNAddressSpaceMMRA(Fence, E, 2);
19112
19116
return Fence;
19113
19117
}
0 commit comments