[llvm] [NewPM] Remove LowerWidenableConditionLegacyPass (PR #72818)
Aiden Grossman via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 19 17:05:30 PST 2023
https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/72818
This legacy pass isn't used anywhere upstream and thus has no test coverage, so remove it.
>From 0557f6dddc350c38f467416cb5de168983f4db04 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <agrossman154 at yahoo.com>
Date: Sun, 19 Nov 2023 17:04:27 -0800
Subject: [PATCH] [NewPM] Remove LowerWidenableConditionLegacyPass
This legacy pass isn't used anywhere upstream and thus has no test
coverage, so remove it.
---
llvm/include/llvm/InitializePasses.h | 1 -
llvm/include/llvm/Transforms/Scalar.h | 6 -----
.../Scalar/LowerWidenableCondition.cpp | 27 -------------------
llvm/lib/Transforms/Scalar/Scalar.cpp | 1 -
4 files changed, 35 deletions(-)
diff --git a/llvm/include/llvm/InitializePasses.h b/llvm/include/llvm/InitializePasses.h
index da38a38b87ebc4d..9299b8e3c7183bd 100644
--- a/llvm/include/llvm/InitializePasses.h
+++ b/llvm/include/llvm/InitializePasses.h
@@ -189,7 +189,6 @@ void initializeLowerAtomicLegacyPassPass(PassRegistry&);
void initializeLowerConstantIntrinsicsPass(PassRegistry&);
void initializeLowerEmuTLSPass(PassRegistry&);
void initializeLowerGlobalDtorsLegacyPassPass(PassRegistry &);
-void initializeLowerWidenableConditionLegacyPassPass(PassRegistry&);
void initializeLowerIntrinsicsPass(PassRegistry&);
void initializeLowerInvokeLegacyPassPass(PassRegistry&);
void initializeLowerSwitchLegacyPassPass(PassRegistry &);
diff --git a/llvm/include/llvm/Transforms/Scalar.h b/llvm/include/llvm/Transforms/Scalar.h
index 0676f485f3fbcf4..a036314b382ceeb 100644
--- a/llvm/include/llvm/Transforms/Scalar.h
+++ b/llvm/include/llvm/Transforms/Scalar.h
@@ -195,12 +195,6 @@ FunctionPass *createSinkingPass();
//
Pass *createLowerAtomicPass();
-//===----------------------------------------------------------------------===//
-//
-// LowerWidenableCondition - Lower widenable condition to i1 true.
-//
-Pass *createLowerWidenableConditionPass();
-
//===----------------------------------------------------------------------===//
//
// MergeICmps - Merge integer comparison chains into a memcmp
diff --git a/llvm/lib/Transforms/Scalar/LowerWidenableCondition.cpp b/llvm/lib/Transforms/Scalar/LowerWidenableCondition.cpp
index e2de322933bc1ba..3c977b816a05067 100644
--- a/llvm/lib/Transforms/Scalar/LowerWidenableCondition.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerWidenableCondition.cpp
@@ -19,24 +19,10 @@
#include "llvm/IR/Intrinsics.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/PatternMatch.h"
-#include "llvm/InitializePasses.h"
-#include "llvm/Pass.h"
#include "llvm/Transforms/Scalar.h"
using namespace llvm;
-namespace {
-struct LowerWidenableConditionLegacyPass : public FunctionPass {
- static char ID;
- LowerWidenableConditionLegacyPass() : FunctionPass(ID) {
- initializeLowerWidenableConditionLegacyPassPass(
- *PassRegistry::getPassRegistry());
- }
-
- bool runOnFunction(Function &F) override;
-};
-}
-
static bool lowerWidenableCondition(Function &F) {
// Check if we can cheaply rule out the possibility of not having any work to
// do.
@@ -65,19 +51,6 @@ static bool lowerWidenableCondition(Function &F) {
return true;
}
-bool LowerWidenableConditionLegacyPass::runOnFunction(Function &F) {
- return lowerWidenableCondition(F);
-}
-
-char LowerWidenableConditionLegacyPass::ID = 0;
-INITIALIZE_PASS(LowerWidenableConditionLegacyPass, "lower-widenable-condition",
- "Lower the widenable condition to default true value", false,
- false)
-
-Pass *llvm::createLowerWidenableConditionPass() {
- return new LowerWidenableConditionLegacyPass();
-}
-
PreservedAnalyses LowerWidenableConditionPass::run(Function &F,
FunctionAnalysisManager &AM) {
if (lowerWidenableCondition(F))
diff --git a/llvm/lib/Transforms/Scalar/Scalar.cpp b/llvm/lib/Transforms/Scalar/Scalar.cpp
index 11bb8e936b74e7c..d3bede56cd5e088 100644
--- a/llvm/lib/Transforms/Scalar/Scalar.cpp
+++ b/llvm/lib/Transforms/Scalar/Scalar.cpp
@@ -41,7 +41,6 @@ void llvm::initializeScalarOpts(PassRegistry &Registry) {
initializeLoopUnrollPass(Registry);
initializeLowerAtomicLegacyPassPass(Registry);
initializeLowerConstantIntrinsicsPass(Registry);
- initializeLowerWidenableConditionLegacyPassPass(Registry);
initializeMergeICmpsLegacyPassPass(Registry);
initializeMergedLoadStoreMotionLegacyPassPass(Registry);
initializeNaryReassociateLegacyPassPass(Registry);
More information about the llvm-commits
mailing list