[llvm-branch-commits] [llvm] f86ec1e - [ScalarizeMaskedMemIntrin] NFC: Convert member functions to static
Anna Thomas via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Dec 3 08:51:27 PST 2020
Author: Anna Thomas
Date: 2020-12-03T11:46:38-05:00
New Revision: f86ec1e1fc4619d4a3974ab849ad362d6f6906eb
URL: https://github.com/llvm/llvm-project/commit/f86ec1e1fc4619d4a3974ab849ad362d6f6906eb
DIFF: https://github.com/llvm/llvm-project/commit/f86ec1e1fc4619d4a3974ab849ad362d6f6906eb.diff
LOG: [ScalarizeMaskedMemIntrin] NFC: Convert member functions to static
This will make it easier to add new PM support once the pass is moved
into transforms (D92407).
Added:
Modified:
llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
Removed:
################################################################################
diff --git a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
index 3443743a28c5..16cd41b8d1b1 100644
--- a/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
+++ b/llvm/lib/CodeGen/ScalarizeMaskedMemIntrin.cpp
@@ -61,14 +61,16 @@ class ScalarizeMaskedMemIntrin : public FunctionPass {
void getAnalysisUsage(AnalysisUsage &AU) const override {
AU.addRequired<TargetTransformInfoWrapperPass>();
}
-
-private:
- bool optimizeBlock(BasicBlock &BB, bool &ModifiedDT);
- bool optimizeCallInst(CallInst *CI, bool &ModifiedDT);
};
} // end anonymous namespace
+static bool optimizeBlock(BasicBlock &BB, bool &ModifiedDT,
+ const TargetTransformInfo *TTI, const DataLayout *DL);
+static bool optimizeCallInst(CallInst *CI, bool &ModifiedDT,
+ const TargetTransformInfo *TTI,
+ const DataLayout *DL);
+
char ScalarizeMaskedMemIntrin::ID = 0;
INITIALIZE_PASS(ScalarizeMaskedMemIntrin, DEBUG_TYPE,
@@ -834,7 +836,7 @@ bool ScalarizeMaskedMemIntrin::runOnFunction(Function &F) {
for (Function::iterator I = F.begin(); I != F.end();) {
BasicBlock *BB = &*I++;
bool ModifiedDTOnIteration = false;
- MadeChange |= optimizeBlock(*BB, ModifiedDTOnIteration);
+ MadeChange |= optimizeBlock(*BB, ModifiedDTOnIteration, TTI, DL);
// Restart BB iteration if the dominator tree of the Function was changed
if (ModifiedDTOnIteration)
@@ -847,13 +849,15 @@ bool ScalarizeMaskedMemIntrin::runOnFunction(Function &F) {
return EverMadeChange;
}
-bool ScalarizeMaskedMemIntrin::optimizeBlock(BasicBlock &BB, bool &ModifiedDT) {
+static bool optimizeBlock(BasicBlock &BB, bool &ModifiedDT,
+ const TargetTransformInfo *TTI,
+ const DataLayout *DL) {
bool MadeChange = false;
BasicBlock::iterator CurInstIterator = BB.begin();
while (CurInstIterator != BB.end()) {
if (CallInst *CI = dyn_cast<CallInst>(&*CurInstIterator++))
- MadeChange |= optimizeCallInst(CI, ModifiedDT);
+ MadeChange |= optimizeCallInst(CI, ModifiedDT, TTI, DL);
if (ModifiedDT)
return true;
}
@@ -861,8 +865,9 @@ bool ScalarizeMaskedMemIntrin::optimizeBlock(BasicBlock &BB, bool &ModifiedDT) {
return MadeChange;
}
-bool ScalarizeMaskedMemIntrin::optimizeCallInst(CallInst *CI,
- bool &ModifiedDT) {
+static bool optimizeCallInst(CallInst *CI, bool &ModifiedDT,
+ const TargetTransformInfo *TTI,
+ const DataLayout *DL) {
IntrinsicInst *II = dyn_cast<IntrinsicInst>(CI);
if (II) {
// The scalarization code below does not work for scalable vectors.
More information about the llvm-branch-commits
mailing list