================
@@ -114,22 +114,23 @@ static Value *handleHlslClip(const CallExpr *E, 
CodeGenFunction *CGF) {
     CMP = CGF->Builder.CreateIntrinsic(
         CGF->Builder.getInt1Ty(), CGF->CGM.getHLSLRuntime().getAnyIntrinsic(),
         {FCompInst}, nullptr);
-  } else
+  } else {
     CMP = CGF->Builder.CreateFCmpOLT(Op0, FZeroConst);
+  }
 
-  if (CGF->CGM.getTarget().getTriple().isDXIL())
+  if (CGF->CGM.getTarget().getTriple().isDXIL()) {
     LastInstr = CGF->Builder.CreateIntrinsic(
         CGF->VoidTy, llvm::Intrinsic::dx_discard, {CMP}, nullptr);
-  else if (CGF->CGM.getTarget().getTriple().isSPIRV()) {
+  } else if (CGF->CGM.getTarget().getTriple().isSPIRV()) {
     BasicBlock *LT0 = CGF->createBasicBlock("lt0", CGF->CurFn);
     BasicBlock *End = CGF->createBasicBlock("end", CGF->CurFn);
 
     CGF->Builder.CreateCondBr(CMP, LT0, End);
 
     CGF->Builder.SetInsertPoint(LT0);
 
-    CGF->Builder.CreateIntrinsic(CGF->VoidTy, llvm::Intrinsic::spv_discard, {},
-                                 nullptr);
+    CGF->Builder.CreateIntrinsic(llvm::Intrinsic::spv_discard,
+                                 ArrayRef<Value *>{}, nullptr);
----------------
jayfoad wrote:

Do you still need the `nullptr` here? (It's the FMFSource argument, right?)

It's a shame you need an explicit `ArrayRef<Value *>{}`. Would something like 
`CreateIntrinsic(llvm::Intrinsic::spv_discard, {}, {})` work instead?

https://github.com/llvm/llvm-project/pull/131942
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to