-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Revert "[NewPM][CodeGen] Port selection dag isel to new pass manager" #94146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@llvm/pr-subscribers-backend-x86 @llvm/pr-subscribers-backend-amdgpu Author: None (paperchalice) ChangesThis reverts commit de37c06 to de37c06 It still breaks EXPENSIVE_CHECKS build. Sorry. Patch is 136.59 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/94146.diff 122 Files Affected:
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index 48cb0cdf851cf..6d28273029bd0 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -29,7 +29,6 @@
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/CodeGen/MachinePassManager.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
@@ -231,7 +230,6 @@ class SelectionDAG {
const TargetLibraryInfo *LibInfo = nullptr;
const FunctionVarLocs *FnVarLocs = nullptr;
MachineFunction *MF;
- MachineFunctionAnalysisManager *MFAM = nullptr;
Pass *SDAGISelPass = nullptr;
LLVMContext *Context;
CodeGenOptLevel OptLevel;
@@ -461,15 +459,6 @@ class SelectionDAG {
UniformityInfo *UA, ProfileSummaryInfo *PSIin,
BlockFrequencyInfo *BFIin, FunctionVarLocs const *FnVarLocs);
- void init(MachineFunction &NewMF, OptimizationRemarkEmitter &NewORE,
- MachineFunctionAnalysisManager &AM,
- const TargetLibraryInfo *LibraryInfo, UniformityInfo *UA,
- ProfileSummaryInfo *PSIin, BlockFrequencyInfo *BFIin,
- FunctionVarLocs const *FnVarLocs) {
- init(NewMF, NewORE, nullptr, LibraryInfo, UA, PSIin, BFIin, FnVarLocs);
- MFAM = &AM;
- }
-
void setFunctionLoweringInfo(FunctionLoweringInfo * FuncInfo) {
FLI = FuncInfo;
}
@@ -480,7 +469,6 @@ class SelectionDAG {
MachineFunction &getMachineFunction() const { return *MF; }
const Pass *getPass() const { return SDAGISelPass; }
- MachineFunctionAnalysisManager *getMFAM() { return MFAM; }
CodeGenOptLevel getOptLevel() const { return OptLevel; }
const DataLayout &getDataLayout() const { return MF->getDataLayout(); }
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGISel.h b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
index 4972af927cf1e..837f8bf7263ea 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGISel.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
@@ -15,7 +15,6 @@
#define LLVM_CODEGEN_SELECTIONDAGISEL_H
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachinePassManager.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/IR/BasicBlock.h"
#include <memory>
@@ -25,7 +24,6 @@ class AAResults;
class AssumptionCache;
class TargetInstrInfo;
class TargetMachine;
-class SSPLayoutInfo;
class SelectionDAGBuilder;
class SDValue;
class MachineRegisterInfo;
@@ -33,7 +31,6 @@ class MachineFunction;
class OptimizationRemarkEmitter;
class TargetLowering;
class TargetLibraryInfo;
-class TargetTransformInfo;
class FunctionLoweringInfo;
class SwiftErrorValueTracking;
class GCFunctionInfo;
@@ -41,7 +38,7 @@ class ScheduleDAGSDNodes;
/// SelectionDAGISel - This is the common base class used for SelectionDAG-based
/// pattern-matching instruction selectors.
-class SelectionDAGISel {
+class SelectionDAGISel : public MachineFunctionPass {
public:
TargetMachine &TM;
const TargetLibraryInfo *LibInfo;
@@ -54,10 +51,6 @@ class SelectionDAGISel {
AAResults *AA = nullptr;
AssumptionCache *AC = nullptr;
GCFunctionInfo *GFI = nullptr;
- SSPLayoutInfo *SP = nullptr;
-#ifndef NDEBUG
- TargetTransformInfo *TTI = nullptr;
-#endif
CodeGenOptLevel OptLevel;
const TargetInstrInfo *TII;
const TargetLowering *TLI;
@@ -74,18 +67,16 @@ class SelectionDAGISel {
/// functions. Storing the filter result here so that we only need to do the
/// filtering once.
bool MatchFilterFuncName = false;
- StringRef FuncName;
- explicit SelectionDAGISel(TargetMachine &tm,
+ explicit SelectionDAGISel(char &ID, TargetMachine &tm,
CodeGenOptLevel OL = CodeGenOptLevel::Default);
- virtual ~SelectionDAGISel();
+ ~SelectionDAGISel() override;
const TargetLowering *getTargetLowering() const { return TLI; }
- void initializeAnalysisResults(MachineFunctionAnalysisManager &MFAM);
- void initializeAnalysisResults(MachineFunctionPass &MFP);
+ void getAnalysisUsage(AnalysisUsage &AU) const override;
- virtual bool runOnMachineFunction(MachineFunction &mf);
+ bool runOnMachineFunction(MachineFunction &MF) override;
virtual void emitFunctionEntryCode() {}
@@ -526,30 +517,6 @@ class SelectionDAGISel {
bool isMorphNodeTo);
};
-class SelectionDAGISelLegacy : public MachineFunctionPass {
- std::unique_ptr<SelectionDAGISel> Selector;
-
-public:
- SelectionDAGISelLegacy(char &ID, std::unique_ptr<SelectionDAGISel> S);
-
- ~SelectionDAGISelLegacy() override = default;
-
- void getAnalysisUsage(AnalysisUsage &AU) const override;
-
- bool runOnMachineFunction(MachineFunction &MF) override;
-};
-
-class SelectionDAGISelPass : public PassInfoMixin<SelectionDAGISelPass> {
- std::unique_ptr<SelectionDAGISel> Selector;
-
-protected:
- SelectionDAGISelPass(std::unique_ptr<SelectionDAGISel> Selector)
- : Selector(std::move(Selector)) {}
-
-public:
- PreservedAnalyses run(MachineFunction &MF,
- MachineFunctionAnalysisManager &MFAM);
-};
}
#endif /* LLVM_CODEGEN_SELECTIONDAGISEL_H */
diff --git a/llvm/include/llvm/CodeGen/StackProtector.h b/llvm/include/llvm/CodeGen/StackProtector.h
index dfafc781067d7..eb5d9d0caebc6 100644
--- a/llvm/include/llvm/CodeGen/StackProtector.h
+++ b/llvm/include/llvm/CodeGen/StackProtector.h
@@ -109,8 +109,6 @@ class StackProtector : public FunctionPass {
StackProtector();
- SSPLayoutInfo &getLayoutInfo() { return LayoutInfo; }
-
void getAnalysisUsage(AnalysisUsage &AU) const override;
// Return true if StackProtector is supposed to be handled by SelectionDAG.
diff --git a/llvm/include/llvm/Passes/CodeGenPassBuilder.h b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
index afe066101c753..17bea5da48ce1 100644
--- a/llvm/include/llvm/Passes/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
@@ -140,9 +140,6 @@ template <typename DerivedT, typename TargetMachineT> class CodeGenPassBuilder {
}
protected:
- template <typename PassT>
- using has_required_t = decltype(std::declval<PassT &>().isRequired());
-
template <typename PassT>
using is_module_pass_t = decltype(std::declval<PassT &>().run(
std::declval<Module &>(), std::declval<ModuleAnalysisManager &>()));
@@ -173,10 +170,8 @@ template <typename DerivedT, typename TargetMachineT> class CodeGenPassBuilder {
static_assert((is_detected<is_function_pass_t, PassT>::value ||
is_detected<is_module_pass_t, PassT>::value) &&
"Only module pass and function pass are supported.");
- bool Required = false;
- if constexpr (is_detected<has_required_t, PassT>::value)
- Required = PassT::isRequired();
- if (!PB.runBeforeAdding(Name) && !Required)
+
+ if (!PB.runBeforeAdding(Name))
return;
// Add Function Pass
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 2c1e557ca1099..8addaf1ae3e54 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -341,49 +341,9 @@ void TargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
// SelectionDAGISel code
//===----------------------------------------------------------------------===//
-SelectionDAGISelLegacy::SelectionDAGISelLegacy(
- char &ID, std::unique_ptr<SelectionDAGISel> S)
- : MachineFunctionPass(ID), Selector(std::move(S)) {
- initializeGCModuleInfoPass(*PassRegistry::getPassRegistry());
- initializeBranchProbabilityInfoWrapperPassPass(
- *PassRegistry::getPassRegistry());
- initializeAAResultsWrapperPassPass(*PassRegistry::getPassRegistry());
- initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry());
-}
-
-bool SelectionDAGISelLegacy::runOnMachineFunction(MachineFunction &MF) {
- // If we already selected that function, we do not need to run SDISel.
- if (MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::Selected))
- return false;
-
- // Do some sanity-checking on the command-line options.
- if (EnableFastISelAbort && !Selector->TM.Options.EnableFastISel)
- report_fatal_error("-fast-isel-abort > 0 requires -fast-isel");
-
- // Decide what flavour of variable location debug-info will be used, before
- // we change the optimisation level.
- MF.setUseDebugInstrRef(MF.shouldUseDebugInstrRef());
-
- // Reset the target options before resetting the optimization
- // level below.
- // FIXME: This is a horrible hack and should be processed via
- // codegen looking at the optimization level explicitly when
- // it wants to look at it.
- Selector->TM.resetTargetOptions(MF.getFunction());
- // Reset OptLevel to None for optnone functions.
- CodeGenOptLevel NewOptLevel = skipFunction(MF.getFunction())
- ? CodeGenOptLevel::None
- : Selector->OptLevel;
-
- Selector->MF = &MF;
- OptLevelChanger OLC(*Selector, NewOptLevel);
- Selector->initializeAnalysisResults(*this);
- return Selector->runOnMachineFunction(MF);
-}
-
-SelectionDAGISel::SelectionDAGISel(TargetMachine &tm, CodeGenOptLevel OL)
- : TM(tm), FuncInfo(new FunctionLoweringInfo()),
+SelectionDAGISel::SelectionDAGISel(char &ID, TargetMachine &tm,
+ CodeGenOptLevel OL)
+ : MachineFunctionPass(ID), TM(tm), FuncInfo(new FunctionLoweringInfo()),
SwiftError(new SwiftErrorValueTracking()),
CurDAG(new SelectionDAG(tm, OL)),
SDB(std::make_unique<SelectionDAGBuilder>(*CurDAG, *FuncInfo, *SwiftError,
@@ -401,17 +361,14 @@ SelectionDAGISel::~SelectionDAGISel() {
delete SwiftError;
}
-void SelectionDAGISelLegacy::getAnalysisUsage(AnalysisUsage &AU) const {
- CodeGenOptLevel OptLevel = Selector->OptLevel;
+void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const {
if (OptLevel != CodeGenOptLevel::None)
AU.addRequired<AAResultsWrapperPass>();
AU.addRequired<GCModuleInfo>();
AU.addRequired<StackProtector>();
AU.addPreserved<GCModuleInfo>();
AU.addRequired<TargetLibraryInfoWrapperPass>();
-#ifndef NDEBUG
AU.addRequired<TargetTransformInfoWrapperPass>();
-#endif
AU.addRequired<AssumptionCacheTracker>();
if (UseMBPI && OptLevel != CodeGenOptLevel::None)
AU.addRequired<BranchProbabilityInfoWrapperPass>();
@@ -449,129 +406,65 @@ static void computeUsesMSVCFloatingPoint(const Triple &TT, const Function &F,
}
}
-PreservedAnalyses
-SelectionDAGISelPass::run(MachineFunction &MF,
- MachineFunctionAnalysisManager &MFAM) {
+bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
// If we already selected that function, we do not need to run SDISel.
- if (MF.getProperties().hasProperty(
+ if (mf.getProperties().hasProperty(
MachineFunctionProperties::Property::Selected))
- return PreservedAnalyses::all();
-
+ return false;
// Do some sanity-checking on the command-line options.
- if (EnableFastISelAbort && !Selector->TM.Options.EnableFastISel)
- report_fatal_error("-fast-isel-abort > 0 requires -fast-isel");
+ assert((!EnableFastISelAbort || TM.Options.EnableFastISel) &&
+ "-fast-isel-abort > 0 requires -fast-isel");
+
+ const Function &Fn = mf.getFunction();
+ MF = &mf;
+
+#ifndef NDEBUG
+ StringRef FuncName = Fn.getName();
+ MatchFilterFuncName = isFunctionInPrintList(FuncName);
+#else
+ (void)MatchFilterFuncName;
+#endif
// Decide what flavour of variable location debug-info will be used, before
// we change the optimisation level.
- MF.setUseDebugInstrRef(MF.shouldUseDebugInstrRef());
+ bool InstrRef = mf.shouldUseDebugInstrRef();
+ mf.setUseDebugInstrRef(InstrRef);
// Reset the target options before resetting the optimization
// level below.
// FIXME: This is a horrible hack and should be processed via
// codegen looking at the optimization level explicitly when
// it wants to look at it.
- Selector->TM.resetTargetOptions(MF.getFunction());
- // Reset OptLevel to None for optnone functions.
- // TODO: Add a function analysis to handle this.
- Selector->MF = &MF;
+ TM.resetTargetOptions(Fn);
// Reset OptLevel to None for optnone functions.
- CodeGenOptLevel NewOptLevel = MF.getFunction().hasOptNone()
- ? CodeGenOptLevel::None
- : Selector->OptLevel;
-
- OptLevelChanger OLC(*Selector, NewOptLevel);
- Selector->initializeAnalysisResults(MFAM);
- Selector->runOnMachineFunction(MF);
-
- return getMachineFunctionPassPreservedAnalyses();
-}
-
-void SelectionDAGISel::initializeAnalysisResults(
- MachineFunctionAnalysisManager &MFAM) {
- auto &FAM = MFAM.getResult<FunctionAnalysisManagerMachineFunctionProxy>(*MF)
- .getManager();
- auto &MAMP = MFAM.getResult<ModuleAnalysisManagerMachineFunctionProxy>(*MF);
- Function &Fn = MF->getFunction();
-#ifndef NDEBUG
- FuncName = Fn.getName();
- MatchFilterFuncName = isFunctionInPrintList(FuncName);
-#else
- (void)MatchFilterFuncName;
-#endif
+ CodeGenOptLevel NewOptLevel = OptLevel;
+ if (OptLevel != CodeGenOptLevel::None && skipFunction(Fn))
+ NewOptLevel = CodeGenOptLevel::None;
+ OptLevelChanger OLC(*this, NewOptLevel);
TII = MF->getSubtarget().getInstrInfo();
TLI = MF->getSubtarget().getTargetLowering();
RegInfo = &MF->getRegInfo();
- LibInfo = &FAM.getResult<TargetLibraryAnalysis>(Fn);
- GFI = Fn.hasGC() ? &FAM.getResult<GCFunctionAnalysis>(Fn) : nullptr;
+ LibInfo = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(Fn);
+ GFI = Fn.hasGC() ? &getAnalysis<GCModuleInfo>().getFunctionInfo(Fn) : nullptr;
ORE = std::make_unique<OptimizationRemarkEmitter>(&Fn);
- AC = &FAM.getResult<AssumptionAnalysis>(Fn);
- auto *PSI = MAMP.getCachedResult<ProfileSummaryAnalysis>(*Fn.getParent());
+ AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(mf.getFunction());
+ auto *PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
BlockFrequencyInfo *BFI = nullptr;
- FAM.getResult<BlockFrequencyAnalysis>(Fn);
if (PSI && PSI->hasProfileSummary() && OptLevel != CodeGenOptLevel::None)
- BFI = &FAM.getResult<BlockFrequencyAnalysis>(Fn);
+ BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
FunctionVarLocs const *FnVarLocs = nullptr;
if (isAssignmentTrackingEnabled(*Fn.getParent()))
- FnVarLocs = &FAM.getResult<DebugAssignmentTrackingAnalysis>(Fn);
+ FnVarLocs = getAnalysis<AssignmentTrackingAnalysis>().getResults();
- auto *UA = FAM.getCachedResult<UniformityInfoAnalysis>(Fn);
- CurDAG->init(*MF, *ORE, MFAM, LibInfo, UA, PSI, BFI, FnVarLocs);
- SwiftError->setFunction(*MF);
-
- // Now get the optional analyzes if we want to.
- // This is based on the possibly changed OptLevel (after optnone is taken
- // into account). That's unfortunate but OK because it just means we won't
- // ask for passes that have been required anyway.
-
- if (UseMBPI && OptLevel != CodeGenOptLevel::None)
- FuncInfo->BPI = &FAM.getResult<BranchProbabilityAnalysis>(Fn);
- else
- FuncInfo->BPI = nullptr;
-
- if (OptLevel != CodeGenOptLevel::None)
- AA = &FAM.getResult<AAManager>(Fn);
- else
- AA = nullptr;
-
- SP = &FAM.getResult<SSPLayoutAnalysis>(Fn);
-
-#ifndef NDEBUG
- TTI = &FAM.getResult<TargetIRAnalysis>(Fn);
-#endif
-}
-
-void SelectionDAGISel::initializeAnalysisResults(MachineFunctionPass &MFP) {
- Function &Fn = MF->getFunction();
-#ifndef NDEBUG
- FuncName = Fn.getName();
- MatchFilterFuncName = isFunctionInPrintList(FuncName);
-#else
- (void)MatchFilterFuncName;
-#endif
-
- TII = MF->getSubtarget().getInstrInfo();
- TLI = MF->getSubtarget().getTargetLowering();
- RegInfo = &MF->getRegInfo();
- LibInfo = &MFP.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(Fn);
- GFI = Fn.hasGC() ? &MFP.getAnalysis<GCModuleInfo>().getFunctionInfo(Fn)
- : nullptr;
- ORE = std::make_unique<OptimizationRemarkEmitter>(&Fn);
- AC = &MFP.getAnalysis<AssumptionCacheTracker>().getAssumptionCache(Fn);
- auto *PSI = &MFP.getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
- BlockFrequencyInfo *BFI = nullptr;
- if (PSI && PSI->hasProfileSummary() && OptLevel != CodeGenOptLevel::None)
- BFI = &MFP.getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
-
- FunctionVarLocs const *FnVarLocs = nullptr;
- if (isAssignmentTrackingEnabled(*Fn.getParent()))
- FnVarLocs = MFP.getAnalysis<AssignmentTrackingAnalysis>().getResults();
+ ISEL_DUMP(dbgs() << "\n\n\n=== " << FuncName << "\n");
UniformityInfo *UA = nullptr;
- if (auto *UAPass = MFP.getAnalysisIfAvailable<UniformityInfoWrapperPass>())
+ if (auto *UAPass = getAnalysisIfAvailable<UniformityInfoWrapperPass>())
UA = &UAPass->getUniformityInfo();
- CurDAG->init(*MF, *ORE, &MFP, LibInfo, UA, PSI, BFI, FnVarLocs);
+ CurDAG->init(*MF, *ORE, this, LibInfo, UA, PSI, BFI, FnVarLocs);
+ FuncInfo->set(Fn, *MF, CurDAG);
SwiftError->setFunction(*MF);
// Now get the optional analyzes if we want to.
@@ -580,32 +473,15 @@ void SelectionDAGISel::initializeAnalysisResults(MachineFunctionPass &MFP) {
// ask for passes that have been required anyway.
if (UseMBPI && OptLevel != CodeGenOptLevel::None)
- FuncInfo->BPI =
- &MFP.getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI();
+ FuncInfo->BPI = &getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI();
else
FuncInfo->BPI = nullptr;
if (OptLevel != CodeGenOptLevel::None)
- AA = &MFP.getAnalysis<AAResultsWrapperPass>().getAAResults();
+ AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
else
AA = nullptr;
- SP = &MFP.getAnalysis<StackProtector>().getLayoutInfo();
-
-#ifndef NDEBUG
- TTI = &MFP.getAnalysis<TargetTransformInfoWrapperPass>().getTTI(Fn);
-#endif
-}
-
-bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
- const Function &Fn = mf.getFunction();
-
- bool InstrRef = mf.shouldUseDebugInstrRef();
-
- FuncInfo->set(MF->getFunction(), *MF, CurDAG);
-
- ISEL_DUMP(dbgs() << "\n\n\n=== " << FuncName << '\n');
-
SDB->init(GFI, AA, AC, LibInfo);
MF->setHasInlineAsm(false);
@@ -900,8 +776,11 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
StringRef GroupName = "sdag";
StringRef GroupDescription = "Instruction Selection and Scheduling";
std::string BlockName;
- bool MatchFilterBB = false;
- (void)MatchFilterBB;
+ bool MatchFilterBB = false; (void)MatchFilterBB;
+#ifndef NDEBUG
+ TargetTransformInfo &TTI =
+ getAnalysis<TargetTransformInfoWrapperPass>().getTTI(*FuncInfo->Fn);
+#endif
// Pre-type legalization allow creation of any node types.
CurDAG->NewNodesMustHaveLegalTypes = false;
@@ -926,7 +805,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -946,7 +825,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -968,7 +847,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -992,7 +871,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
}
@@ -1010,7 +889,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -1026,7 +905,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -1046,7 +925,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- ...
[truncated]
|
@llvm/pr-subscribers-backend-powerpc Author: None (paperchalice) ChangesThis reverts commit de37c06 to de37c06 It still breaks EXPENSIVE_CHECKS build. Sorry. Patch is 136.59 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/94146.diff 122 Files Affected:
diff --git a/llvm/include/llvm/CodeGen/SelectionDAG.h b/llvm/include/llvm/CodeGen/SelectionDAG.h
index 48cb0cdf851cf..6d28273029bd0 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAG.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAG.h
@@ -29,7 +29,6 @@
#include "llvm/CodeGen/ISDOpcodes.h"
#include "llvm/CodeGen/MachineFunction.h"
#include "llvm/CodeGen/MachineMemOperand.h"
-#include "llvm/CodeGen/MachinePassManager.h"
#include "llvm/CodeGen/SelectionDAGNodes.h"
#include "llvm/CodeGen/ValueTypes.h"
#include "llvm/CodeGenTypes/MachineValueType.h"
@@ -231,7 +230,6 @@ class SelectionDAG {
const TargetLibraryInfo *LibInfo = nullptr;
const FunctionVarLocs *FnVarLocs = nullptr;
MachineFunction *MF;
- MachineFunctionAnalysisManager *MFAM = nullptr;
Pass *SDAGISelPass = nullptr;
LLVMContext *Context;
CodeGenOptLevel OptLevel;
@@ -461,15 +459,6 @@ class SelectionDAG {
UniformityInfo *UA, ProfileSummaryInfo *PSIin,
BlockFrequencyInfo *BFIin, FunctionVarLocs const *FnVarLocs);
- void init(MachineFunction &NewMF, OptimizationRemarkEmitter &NewORE,
- MachineFunctionAnalysisManager &AM,
- const TargetLibraryInfo *LibraryInfo, UniformityInfo *UA,
- ProfileSummaryInfo *PSIin, BlockFrequencyInfo *BFIin,
- FunctionVarLocs const *FnVarLocs) {
- init(NewMF, NewORE, nullptr, LibraryInfo, UA, PSIin, BFIin, FnVarLocs);
- MFAM = &AM;
- }
-
void setFunctionLoweringInfo(FunctionLoweringInfo * FuncInfo) {
FLI = FuncInfo;
}
@@ -480,7 +469,6 @@ class SelectionDAG {
MachineFunction &getMachineFunction() const { return *MF; }
const Pass *getPass() const { return SDAGISelPass; }
- MachineFunctionAnalysisManager *getMFAM() { return MFAM; }
CodeGenOptLevel getOptLevel() const { return OptLevel; }
const DataLayout &getDataLayout() const { return MF->getDataLayout(); }
diff --git a/llvm/include/llvm/CodeGen/SelectionDAGISel.h b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
index 4972af927cf1e..837f8bf7263ea 100644
--- a/llvm/include/llvm/CodeGen/SelectionDAGISel.h
+++ b/llvm/include/llvm/CodeGen/SelectionDAGISel.h
@@ -15,7 +15,6 @@
#define LLVM_CODEGEN_SELECTIONDAGISEL_H
#include "llvm/CodeGen/MachineFunctionPass.h"
-#include "llvm/CodeGen/MachinePassManager.h"
#include "llvm/CodeGen/SelectionDAG.h"
#include "llvm/IR/BasicBlock.h"
#include <memory>
@@ -25,7 +24,6 @@ class AAResults;
class AssumptionCache;
class TargetInstrInfo;
class TargetMachine;
-class SSPLayoutInfo;
class SelectionDAGBuilder;
class SDValue;
class MachineRegisterInfo;
@@ -33,7 +31,6 @@ class MachineFunction;
class OptimizationRemarkEmitter;
class TargetLowering;
class TargetLibraryInfo;
-class TargetTransformInfo;
class FunctionLoweringInfo;
class SwiftErrorValueTracking;
class GCFunctionInfo;
@@ -41,7 +38,7 @@ class ScheduleDAGSDNodes;
/// SelectionDAGISel - This is the common base class used for SelectionDAG-based
/// pattern-matching instruction selectors.
-class SelectionDAGISel {
+class SelectionDAGISel : public MachineFunctionPass {
public:
TargetMachine &TM;
const TargetLibraryInfo *LibInfo;
@@ -54,10 +51,6 @@ class SelectionDAGISel {
AAResults *AA = nullptr;
AssumptionCache *AC = nullptr;
GCFunctionInfo *GFI = nullptr;
- SSPLayoutInfo *SP = nullptr;
-#ifndef NDEBUG
- TargetTransformInfo *TTI = nullptr;
-#endif
CodeGenOptLevel OptLevel;
const TargetInstrInfo *TII;
const TargetLowering *TLI;
@@ -74,18 +67,16 @@ class SelectionDAGISel {
/// functions. Storing the filter result here so that we only need to do the
/// filtering once.
bool MatchFilterFuncName = false;
- StringRef FuncName;
- explicit SelectionDAGISel(TargetMachine &tm,
+ explicit SelectionDAGISel(char &ID, TargetMachine &tm,
CodeGenOptLevel OL = CodeGenOptLevel::Default);
- virtual ~SelectionDAGISel();
+ ~SelectionDAGISel() override;
const TargetLowering *getTargetLowering() const { return TLI; }
- void initializeAnalysisResults(MachineFunctionAnalysisManager &MFAM);
- void initializeAnalysisResults(MachineFunctionPass &MFP);
+ void getAnalysisUsage(AnalysisUsage &AU) const override;
- virtual bool runOnMachineFunction(MachineFunction &mf);
+ bool runOnMachineFunction(MachineFunction &MF) override;
virtual void emitFunctionEntryCode() {}
@@ -526,30 +517,6 @@ class SelectionDAGISel {
bool isMorphNodeTo);
};
-class SelectionDAGISelLegacy : public MachineFunctionPass {
- std::unique_ptr<SelectionDAGISel> Selector;
-
-public:
- SelectionDAGISelLegacy(char &ID, std::unique_ptr<SelectionDAGISel> S);
-
- ~SelectionDAGISelLegacy() override = default;
-
- void getAnalysisUsage(AnalysisUsage &AU) const override;
-
- bool runOnMachineFunction(MachineFunction &MF) override;
-};
-
-class SelectionDAGISelPass : public PassInfoMixin<SelectionDAGISelPass> {
- std::unique_ptr<SelectionDAGISel> Selector;
-
-protected:
- SelectionDAGISelPass(std::unique_ptr<SelectionDAGISel> Selector)
- : Selector(std::move(Selector)) {}
-
-public:
- PreservedAnalyses run(MachineFunction &MF,
- MachineFunctionAnalysisManager &MFAM);
-};
}
#endif /* LLVM_CODEGEN_SELECTIONDAGISEL_H */
diff --git a/llvm/include/llvm/CodeGen/StackProtector.h b/llvm/include/llvm/CodeGen/StackProtector.h
index dfafc781067d7..eb5d9d0caebc6 100644
--- a/llvm/include/llvm/CodeGen/StackProtector.h
+++ b/llvm/include/llvm/CodeGen/StackProtector.h
@@ -109,8 +109,6 @@ class StackProtector : public FunctionPass {
StackProtector();
- SSPLayoutInfo &getLayoutInfo() { return LayoutInfo; }
-
void getAnalysisUsage(AnalysisUsage &AU) const override;
// Return true if StackProtector is supposed to be handled by SelectionDAG.
diff --git a/llvm/include/llvm/Passes/CodeGenPassBuilder.h b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
index afe066101c753..17bea5da48ce1 100644
--- a/llvm/include/llvm/Passes/CodeGenPassBuilder.h
+++ b/llvm/include/llvm/Passes/CodeGenPassBuilder.h
@@ -140,9 +140,6 @@ template <typename DerivedT, typename TargetMachineT> class CodeGenPassBuilder {
}
protected:
- template <typename PassT>
- using has_required_t = decltype(std::declval<PassT &>().isRequired());
-
template <typename PassT>
using is_module_pass_t = decltype(std::declval<PassT &>().run(
std::declval<Module &>(), std::declval<ModuleAnalysisManager &>()));
@@ -173,10 +170,8 @@ template <typename DerivedT, typename TargetMachineT> class CodeGenPassBuilder {
static_assert((is_detected<is_function_pass_t, PassT>::value ||
is_detected<is_module_pass_t, PassT>::value) &&
"Only module pass and function pass are supported.");
- bool Required = false;
- if constexpr (is_detected<has_required_t, PassT>::value)
- Required = PassT::isRequired();
- if (!PB.runBeforeAdding(Name) && !Required)
+
+ if (!PB.runBeforeAdding(Name))
return;
// Add Function Pass
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 2c1e557ca1099..8addaf1ae3e54 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -341,49 +341,9 @@ void TargetLowering::AdjustInstrPostInstrSelection(MachineInstr &MI,
// SelectionDAGISel code
//===----------------------------------------------------------------------===//
-SelectionDAGISelLegacy::SelectionDAGISelLegacy(
- char &ID, std::unique_ptr<SelectionDAGISel> S)
- : MachineFunctionPass(ID), Selector(std::move(S)) {
- initializeGCModuleInfoPass(*PassRegistry::getPassRegistry());
- initializeBranchProbabilityInfoWrapperPassPass(
- *PassRegistry::getPassRegistry());
- initializeAAResultsWrapperPassPass(*PassRegistry::getPassRegistry());
- initializeTargetLibraryInfoWrapperPassPass(*PassRegistry::getPassRegistry());
-}
-
-bool SelectionDAGISelLegacy::runOnMachineFunction(MachineFunction &MF) {
- // If we already selected that function, we do not need to run SDISel.
- if (MF.getProperties().hasProperty(
- MachineFunctionProperties::Property::Selected))
- return false;
-
- // Do some sanity-checking on the command-line options.
- if (EnableFastISelAbort && !Selector->TM.Options.EnableFastISel)
- report_fatal_error("-fast-isel-abort > 0 requires -fast-isel");
-
- // Decide what flavour of variable location debug-info will be used, before
- // we change the optimisation level.
- MF.setUseDebugInstrRef(MF.shouldUseDebugInstrRef());
-
- // Reset the target options before resetting the optimization
- // level below.
- // FIXME: This is a horrible hack and should be processed via
- // codegen looking at the optimization level explicitly when
- // it wants to look at it.
- Selector->TM.resetTargetOptions(MF.getFunction());
- // Reset OptLevel to None for optnone functions.
- CodeGenOptLevel NewOptLevel = skipFunction(MF.getFunction())
- ? CodeGenOptLevel::None
- : Selector->OptLevel;
-
- Selector->MF = &MF;
- OptLevelChanger OLC(*Selector, NewOptLevel);
- Selector->initializeAnalysisResults(*this);
- return Selector->runOnMachineFunction(MF);
-}
-
-SelectionDAGISel::SelectionDAGISel(TargetMachine &tm, CodeGenOptLevel OL)
- : TM(tm), FuncInfo(new FunctionLoweringInfo()),
+SelectionDAGISel::SelectionDAGISel(char &ID, TargetMachine &tm,
+ CodeGenOptLevel OL)
+ : MachineFunctionPass(ID), TM(tm), FuncInfo(new FunctionLoweringInfo()),
SwiftError(new SwiftErrorValueTracking()),
CurDAG(new SelectionDAG(tm, OL)),
SDB(std::make_unique<SelectionDAGBuilder>(*CurDAG, *FuncInfo, *SwiftError,
@@ -401,17 +361,14 @@ SelectionDAGISel::~SelectionDAGISel() {
delete SwiftError;
}
-void SelectionDAGISelLegacy::getAnalysisUsage(AnalysisUsage &AU) const {
- CodeGenOptLevel OptLevel = Selector->OptLevel;
+void SelectionDAGISel::getAnalysisUsage(AnalysisUsage &AU) const {
if (OptLevel != CodeGenOptLevel::None)
AU.addRequired<AAResultsWrapperPass>();
AU.addRequired<GCModuleInfo>();
AU.addRequired<StackProtector>();
AU.addPreserved<GCModuleInfo>();
AU.addRequired<TargetLibraryInfoWrapperPass>();
-#ifndef NDEBUG
AU.addRequired<TargetTransformInfoWrapperPass>();
-#endif
AU.addRequired<AssumptionCacheTracker>();
if (UseMBPI && OptLevel != CodeGenOptLevel::None)
AU.addRequired<BranchProbabilityInfoWrapperPass>();
@@ -449,129 +406,65 @@ static void computeUsesMSVCFloatingPoint(const Triple &TT, const Function &F,
}
}
-PreservedAnalyses
-SelectionDAGISelPass::run(MachineFunction &MF,
- MachineFunctionAnalysisManager &MFAM) {
+bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
// If we already selected that function, we do not need to run SDISel.
- if (MF.getProperties().hasProperty(
+ if (mf.getProperties().hasProperty(
MachineFunctionProperties::Property::Selected))
- return PreservedAnalyses::all();
-
+ return false;
// Do some sanity-checking on the command-line options.
- if (EnableFastISelAbort && !Selector->TM.Options.EnableFastISel)
- report_fatal_error("-fast-isel-abort > 0 requires -fast-isel");
+ assert((!EnableFastISelAbort || TM.Options.EnableFastISel) &&
+ "-fast-isel-abort > 0 requires -fast-isel");
+
+ const Function &Fn = mf.getFunction();
+ MF = &mf;
+
+#ifndef NDEBUG
+ StringRef FuncName = Fn.getName();
+ MatchFilterFuncName = isFunctionInPrintList(FuncName);
+#else
+ (void)MatchFilterFuncName;
+#endif
// Decide what flavour of variable location debug-info will be used, before
// we change the optimisation level.
- MF.setUseDebugInstrRef(MF.shouldUseDebugInstrRef());
+ bool InstrRef = mf.shouldUseDebugInstrRef();
+ mf.setUseDebugInstrRef(InstrRef);
// Reset the target options before resetting the optimization
// level below.
// FIXME: This is a horrible hack and should be processed via
// codegen looking at the optimization level explicitly when
// it wants to look at it.
- Selector->TM.resetTargetOptions(MF.getFunction());
- // Reset OptLevel to None for optnone functions.
- // TODO: Add a function analysis to handle this.
- Selector->MF = &MF;
+ TM.resetTargetOptions(Fn);
// Reset OptLevel to None for optnone functions.
- CodeGenOptLevel NewOptLevel = MF.getFunction().hasOptNone()
- ? CodeGenOptLevel::None
- : Selector->OptLevel;
-
- OptLevelChanger OLC(*Selector, NewOptLevel);
- Selector->initializeAnalysisResults(MFAM);
- Selector->runOnMachineFunction(MF);
-
- return getMachineFunctionPassPreservedAnalyses();
-}
-
-void SelectionDAGISel::initializeAnalysisResults(
- MachineFunctionAnalysisManager &MFAM) {
- auto &FAM = MFAM.getResult<FunctionAnalysisManagerMachineFunctionProxy>(*MF)
- .getManager();
- auto &MAMP = MFAM.getResult<ModuleAnalysisManagerMachineFunctionProxy>(*MF);
- Function &Fn = MF->getFunction();
-#ifndef NDEBUG
- FuncName = Fn.getName();
- MatchFilterFuncName = isFunctionInPrintList(FuncName);
-#else
- (void)MatchFilterFuncName;
-#endif
+ CodeGenOptLevel NewOptLevel = OptLevel;
+ if (OptLevel != CodeGenOptLevel::None && skipFunction(Fn))
+ NewOptLevel = CodeGenOptLevel::None;
+ OptLevelChanger OLC(*this, NewOptLevel);
TII = MF->getSubtarget().getInstrInfo();
TLI = MF->getSubtarget().getTargetLowering();
RegInfo = &MF->getRegInfo();
- LibInfo = &FAM.getResult<TargetLibraryAnalysis>(Fn);
- GFI = Fn.hasGC() ? &FAM.getResult<GCFunctionAnalysis>(Fn) : nullptr;
+ LibInfo = &getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(Fn);
+ GFI = Fn.hasGC() ? &getAnalysis<GCModuleInfo>().getFunctionInfo(Fn) : nullptr;
ORE = std::make_unique<OptimizationRemarkEmitter>(&Fn);
- AC = &FAM.getResult<AssumptionAnalysis>(Fn);
- auto *PSI = MAMP.getCachedResult<ProfileSummaryAnalysis>(*Fn.getParent());
+ AC = &getAnalysis<AssumptionCacheTracker>().getAssumptionCache(mf.getFunction());
+ auto *PSI = &getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
BlockFrequencyInfo *BFI = nullptr;
- FAM.getResult<BlockFrequencyAnalysis>(Fn);
if (PSI && PSI->hasProfileSummary() && OptLevel != CodeGenOptLevel::None)
- BFI = &FAM.getResult<BlockFrequencyAnalysis>(Fn);
+ BFI = &getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
FunctionVarLocs const *FnVarLocs = nullptr;
if (isAssignmentTrackingEnabled(*Fn.getParent()))
- FnVarLocs = &FAM.getResult<DebugAssignmentTrackingAnalysis>(Fn);
+ FnVarLocs = getAnalysis<AssignmentTrackingAnalysis>().getResults();
- auto *UA = FAM.getCachedResult<UniformityInfoAnalysis>(Fn);
- CurDAG->init(*MF, *ORE, MFAM, LibInfo, UA, PSI, BFI, FnVarLocs);
- SwiftError->setFunction(*MF);
-
- // Now get the optional analyzes if we want to.
- // This is based on the possibly changed OptLevel (after optnone is taken
- // into account). That's unfortunate but OK because it just means we won't
- // ask for passes that have been required anyway.
-
- if (UseMBPI && OptLevel != CodeGenOptLevel::None)
- FuncInfo->BPI = &FAM.getResult<BranchProbabilityAnalysis>(Fn);
- else
- FuncInfo->BPI = nullptr;
-
- if (OptLevel != CodeGenOptLevel::None)
- AA = &FAM.getResult<AAManager>(Fn);
- else
- AA = nullptr;
-
- SP = &FAM.getResult<SSPLayoutAnalysis>(Fn);
-
-#ifndef NDEBUG
- TTI = &FAM.getResult<TargetIRAnalysis>(Fn);
-#endif
-}
-
-void SelectionDAGISel::initializeAnalysisResults(MachineFunctionPass &MFP) {
- Function &Fn = MF->getFunction();
-#ifndef NDEBUG
- FuncName = Fn.getName();
- MatchFilterFuncName = isFunctionInPrintList(FuncName);
-#else
- (void)MatchFilterFuncName;
-#endif
-
- TII = MF->getSubtarget().getInstrInfo();
- TLI = MF->getSubtarget().getTargetLowering();
- RegInfo = &MF->getRegInfo();
- LibInfo = &MFP.getAnalysis<TargetLibraryInfoWrapperPass>().getTLI(Fn);
- GFI = Fn.hasGC() ? &MFP.getAnalysis<GCModuleInfo>().getFunctionInfo(Fn)
- : nullptr;
- ORE = std::make_unique<OptimizationRemarkEmitter>(&Fn);
- AC = &MFP.getAnalysis<AssumptionCacheTracker>().getAssumptionCache(Fn);
- auto *PSI = &MFP.getAnalysis<ProfileSummaryInfoWrapperPass>().getPSI();
- BlockFrequencyInfo *BFI = nullptr;
- if (PSI && PSI->hasProfileSummary() && OptLevel != CodeGenOptLevel::None)
- BFI = &MFP.getAnalysis<LazyBlockFrequencyInfoPass>().getBFI();
-
- FunctionVarLocs const *FnVarLocs = nullptr;
- if (isAssignmentTrackingEnabled(*Fn.getParent()))
- FnVarLocs = MFP.getAnalysis<AssignmentTrackingAnalysis>().getResults();
+ ISEL_DUMP(dbgs() << "\n\n\n=== " << FuncName << "\n");
UniformityInfo *UA = nullptr;
- if (auto *UAPass = MFP.getAnalysisIfAvailable<UniformityInfoWrapperPass>())
+ if (auto *UAPass = getAnalysisIfAvailable<UniformityInfoWrapperPass>())
UA = &UAPass->getUniformityInfo();
- CurDAG->init(*MF, *ORE, &MFP, LibInfo, UA, PSI, BFI, FnVarLocs);
+ CurDAG->init(*MF, *ORE, this, LibInfo, UA, PSI, BFI, FnVarLocs);
+ FuncInfo->set(Fn, *MF, CurDAG);
SwiftError->setFunction(*MF);
// Now get the optional analyzes if we want to.
@@ -580,32 +473,15 @@ void SelectionDAGISel::initializeAnalysisResults(MachineFunctionPass &MFP) {
// ask for passes that have been required anyway.
if (UseMBPI && OptLevel != CodeGenOptLevel::None)
- FuncInfo->BPI =
- &MFP.getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI();
+ FuncInfo->BPI = &getAnalysis<BranchProbabilityInfoWrapperPass>().getBPI();
else
FuncInfo->BPI = nullptr;
if (OptLevel != CodeGenOptLevel::None)
- AA = &MFP.getAnalysis<AAResultsWrapperPass>().getAAResults();
+ AA = &getAnalysis<AAResultsWrapperPass>().getAAResults();
else
AA = nullptr;
- SP = &MFP.getAnalysis<StackProtector>().getLayoutInfo();
-
-#ifndef NDEBUG
- TTI = &MFP.getAnalysis<TargetTransformInfoWrapperPass>().getTTI(Fn);
-#endif
-}
-
-bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
- const Function &Fn = mf.getFunction();
-
- bool InstrRef = mf.shouldUseDebugInstrRef();
-
- FuncInfo->set(MF->getFunction(), *MF, CurDAG);
-
- ISEL_DUMP(dbgs() << "\n\n\n=== " << FuncName << '\n');
-
SDB->init(GFI, AA, AC, LibInfo);
MF->setHasInlineAsm(false);
@@ -900,8 +776,11 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
StringRef GroupName = "sdag";
StringRef GroupDescription = "Instruction Selection and Scheduling";
std::string BlockName;
- bool MatchFilterBB = false;
- (void)MatchFilterBB;
+ bool MatchFilterBB = false; (void)MatchFilterBB;
+#ifndef NDEBUG
+ TargetTransformInfo &TTI =
+ getAnalysis<TargetTransformInfoWrapperPass>().getTTI(*FuncInfo->Fn);
+#endif
// Pre-type legalization allow creation of any node types.
CurDAG->NewNodesMustHaveLegalTypes = false;
@@ -926,7 +805,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -946,7 +825,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -968,7 +847,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -992,7 +871,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
}
@@ -1010,7 +889,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -1026,7 +905,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- if (TTI->hasBranchDivergence())
+ if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
@@ -1046,7 +925,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
CurDAG->dump());
#ifndef NDEBUG
- ...
[truncated]
|
This reverts commit de37c06 to de37c06
It still breaks EXPENSIVE_CHECKS build. Sorry.