[llvm] 8b36c43 - [ArgPromotion] Make areFunctionArgsABICompatible() static (NFC)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 28 06:26:44 PST 2022
Author: Nikita Popov
Date: 2022-01-28T15:26:36+01:00
New Revision: 8b36c437df4a71553caa6fd7419f552b7aa7771d
URL: https://github.com/llvm/llvm-project/commit/8b36c437df4a71553caa6fd7419f552b7aa7771d
DIFF: https://github.com/llvm/llvm-project/commit/8b36c437df4a71553caa6fd7419f552b7aa7771d.diff
LOG: [ArgPromotion] Make areFunctionArgsABICompatible() static (NFC)
This function used to be shared with the Attributor, but can now
be made private.
Added:
Modified:
llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
index 6d6cb58abdbb5..225def99678a3 100644
--- a/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
+++ b/llvm/include/llvm/Transforms/IPO/ArgumentPromotion.h
@@ -27,14 +27,6 @@ class ArgumentPromotionPass : public PassInfoMixin<ArgumentPromotionPass> {
public:
ArgumentPromotionPass(unsigned MaxElements = 3u) : MaxElements(MaxElements) {}
- /// Check if callers and the callee \p F agree how promoted arguments would be
- /// passed. The ones that they do not agree on are eliminated from the sets but
- /// the return value has to be observed as well.
- static bool areFunctionArgsABICompatible(
- const Function &F, const TargetTransformInfo &TTI,
- SmallPtrSetImpl<Argument *> &ArgsToPromote,
- SmallPtrSetImpl<Argument *> &ByValArgsToTransform);
-
/// Checks if a type could have padding bytes.
static bool isDenselyPacked(Type *type, const DataLayout &DL);
diff --git a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
index ce3c5153bde27..ea7baeb3813d0 100644
--- a/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/llvm/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -830,7 +830,10 @@ static bool canPaddingBeAccessed(Argument *arg) {
return false;
}
-bool ArgumentPromotionPass::areFunctionArgsABICompatible(
+/// Check if callers and the callee \p F agree how promoted arguments would be
+/// passed. The ones that they do not agree on are eliminated from the sets but
+/// the return value has to be observed as well.
+static bool areFunctionArgsABICompatible(
const Function &F, const TargetTransformInfo &TTI,
SmallPtrSetImpl<Argument *> &ArgsToPromote,
SmallPtrSetImpl<Argument *> &ByValArgsToTransform) {
@@ -1003,7 +1006,7 @@ promoteArguments(Function *F, function_ref<AAResults &(Function &F)> AARGetter,
if (ArgsToPromote.empty() && ByValArgsToTransform.empty())
return nullptr;
- if (!ArgumentPromotionPass::areFunctionArgsABICompatible(
+ if (!areFunctionArgsABICompatible(
*F, TTI, ArgsToPromote, ByValArgsToTransform))
return nullptr;
More information about the llvm-commits
mailing list