[llvm] 1393f4e - [MemCpyOpt] Use doesNotCapture() helper (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 14 05:28:26 PST 2025
Author: Nikita Popov
Date: 2025-01-14T14:28:11+01:00
New Revision: 1393f4e69f92f31e6a7ffd63676ef8fd62d1f882
URL: https://github.com/llvm/llvm-project/commit/1393f4e69f92f31e6a7ffd63676ef8fd62d1f882
DIFF: https://github.com/llvm/llvm-project/commit/1393f4e69f92f31e6a7ffd63676ef8fd62d1f882.diff
LOG: [MemCpyOpt] Use doesNotCapture() helper (NFC)
No difference in semantics here as byval is already handled
separately. This simplifies migration to the captures attribute.
Added:
Modified:
llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
index 1de3219bc80429..5759046d67d67a 100644
--- a/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
+++ b/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp
@@ -2010,7 +2010,7 @@ bool MemCpyOptPass::processImmutArgument(CallBase &CB, unsigned ArgNo) {
Value *ImmutArg = CB.getArgOperand(ArgNo);
// 1. Ensure passed argument is immutable during call.
- if (!CB.paramHasAttr(ArgNo, Attribute::NoCapture))
+ if (!CB.doesNotCapture(ArgNo))
return false;
// We know that the argument is readonly at this point, but the function
More information about the llvm-commits
mailing list