Skip to content
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

Reland "[NewPM][CodeGen] Port selection dag isel to new pass manager" #94149

Merged
merged 2 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Address comments
  • Loading branch information
paperchalice committed Jun 3, 2024
commit d592b8988267635ac14dbb74bf6943430bf54a1a
2 changes: 1 addition & 1 deletion llvm/include/llvm/CodeGen/SelectionDAGISel.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SelectionDAGISel {
AssumptionCache *AC = nullptr;
GCFunctionInfo *GFI = nullptr;
SSPLayoutInfo *SP = nullptr;
#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
TargetTransformInfo *TTI = nullptr;
#endif
CodeGenOptLevel OptLevel;
Expand Down
21 changes: 10 additions & 11 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -518,7 +518,6 @@ void SelectionDAGISel::initializeAnalysisResults(

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
Expand Down Expand Up @@ -572,7 +571,6 @@ void SelectionDAGISel::initializeAnalysisResults(MachineFunctionPass &MFP) {
if (auto *UAPass = MFP.getAnalysisIfAvailable<UniformityInfoWrapperPass>())
UA = &UAPass->getUniformityInfo();
CurDAG->init(*MF, *ORE, &MFP, 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
Expand All @@ -598,6 +596,7 @@ void SelectionDAGISel::initializeAnalysisResults(MachineFunctionPass &MFP) {
}

bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
SwiftError->setFunction(mf);
const Function &Fn = mf.getFunction();

bool InstrRef = mf.shouldUseDebugInstrRef();
Expand Down Expand Up @@ -925,7 +924,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can this line compile when NDEBUG is defined, if the declaration of VerifyDAGDivergence is guarded by #ifndef NDEBUG?

#ifndef NDEBUG
void VerifyDAGDivergence();
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was assumed here that assertion implies abi breaking checks, sorry for the breaking. 😥

#endif
Expand All @@ -945,7 +944,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand All @@ -967,7 +966,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand All @@ -991,7 +990,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand All @@ -1009,7 +1008,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand All @@ -1025,7 +1024,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand All @@ -1045,7 +1044,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand All @@ -1065,7 +1064,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand All @@ -1085,7 +1084,7 @@ void SelectionDAGISel::CodeGenAndEmitDAG() {
<< "'\n";
CurDAG->dump());

#ifndef NDEBUG
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
if (TTI->hasBranchDivergence())
CurDAG->VerifyDAGDivergence();
#endif
Expand Down
Loading