https://github.com/kazutakahirata updated https://github.com/llvm/llvm-project/pull/96085
>From 62c24545350105e24a5be6334fe7c8075c2a633d Mon Sep 17 00:00:00 2001 From: Kazu Hirata <k...@google.com> Date: Wed, 19 Jun 2024 08:43:00 -0700 Subject: [PATCH 1/2] [CodeGen] Remove extraneous ArrayRef (NFC) ArrayRef can infer the size of a C array. Also, C arrays can be implicitly cast to ArrayRef. --- clang/lib/CodeGen/CodeGenPGO.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index 2839697614595..f2cdeb5796d3a 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -1200,15 +1200,14 @@ void CodeGenPGO::emitCounterSetOrIncrement(CGBuilderTy &Builder, const Stmt *S, if (llvm::EnableSingleByteCoverage) Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::instrprof_cover), - ArrayRef(Args, 4)); + Args); else { if (!StepV) Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::instrprof_increment), - ArrayRef(Args, 4)); + Args); else Builder.CreateCall( - CGM.getIntrinsic(llvm::Intrinsic::instrprof_increment_step), - ArrayRef(Args)); + CGM.getIntrinsic(llvm::Intrinsic::instrprof_increment_step), Args); } } >From e2a507bb29cbd4778ceb147f7947ba0e3fd397c4 Mon Sep 17 00:00:00 2001 From: Kazu Hirata <k...@google.com> Date: Wed, 19 Jun 2024 09:10:44 -0700 Subject: [PATCH 2/2] Partially revert changes. --- clang/lib/CodeGen/CodeGenPGO.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clang/lib/CodeGen/CodeGenPGO.cpp b/clang/lib/CodeGen/CodeGenPGO.cpp index f2cdeb5796d3a..ea726b5708a4a 100644 --- a/clang/lib/CodeGen/CodeGenPGO.cpp +++ b/clang/lib/CodeGen/CodeGenPGO.cpp @@ -1200,11 +1200,11 @@ void CodeGenPGO::emitCounterSetOrIncrement(CGBuilderTy &Builder, const Stmt *S, if (llvm::EnableSingleByteCoverage) Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::instrprof_cover), - Args); + ArrayRef(Args, 4)); else { if (!StepV) Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::instrprof_increment), - Args); + ArrayRef(Args, 4)); else Builder.CreateCall( CGM.getIntrinsic(llvm::Intrinsic::instrprof_increment_step), Args); _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits