Skip to content

Commit e6d123f

Browse files
wenju-hesys-ce-bb
authored andcommitted
Mark all passes as required in LLVM new pass manager (#2281)
When these passes are used in LLVM new pass manager, they can't be skipped since they are not optimization passes which are optional. Before this PR I'm seeing crash in compiler when bisecting pass manager. Original commit: KhronosGroup/SPIRV-LLVM-Translator@a682bb3
1 parent e9364f9 commit e6d123f

11 files changed

+24
-0
lines changed

llvm-spirv/lib/SPIRV/OCLToSPIRV.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ class OCLToSPIRVPass : public OCLToSPIRVBase,
304304
public:
305305
llvm::PreservedAnalyses run(llvm::Module &M,
306306
llvm::ModuleAnalysisManager &MAM);
307+
308+
static bool isRequired() { return true; }
307309
};
308310

309311
} // namespace SPIRV

llvm-spirv/lib/SPIRV/PreprocessMetadata.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@ class PreprocessMetadataPass
8383
public:
8484
llvm::PreservedAnalyses run(llvm::Module &M,
8585
llvm::ModuleAnalysisManager &MAM);
86+
87+
static bool isRequired() { return true; }
8688
};
8789

8890
} // namespace SPIRV

llvm-spirv/lib/SPIRV/SPIRVLowerBitCastToNonStandardType.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class SPIRVLowerBitCastToNonStandardTypePass
5151
llvm::PreservedAnalyses run(llvm::Function &F,
5252
llvm::FunctionAnalysisManager &FAM);
5353

54+
static bool isRequired() { return true; }
55+
5456
private:
5557
SPIRV::TranslatorOpts Opts;
5658
};

llvm-spirv/lib/SPIRV/SPIRVLowerBool.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ class SPIRVLowerBoolPass : public llvm::PassInfoMixin<SPIRVLowerBoolPass>,
7070
public:
7171
llvm::PreservedAnalyses run(llvm::Module &M,
7272
llvm::ModuleAnalysisManager &MAM);
73+
74+
static bool isRequired() { return true; }
7375
};
7476

7577
class SPIRVLowerBoolLegacy : public llvm::ModulePass,

llvm-spirv/lib/SPIRV/SPIRVLowerConstExpr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ class SPIRVLowerConstExprPass
4040
return runLowerConstExpr(M) ? llvm::PreservedAnalyses::none()
4141
: llvm::PreservedAnalyses::all();
4242
}
43+
44+
static bool isRequired() { return true; }
4345
};
4446

4547
} // namespace SPIRV

llvm-spirv/lib/SPIRV/SPIRVLowerMemmove.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ class SPIRVLowerMemmovePass : public llvm::PassInfoMixin<SPIRVLowerMemmovePass>,
6363
public:
6464
llvm::PreservedAnalyses run(llvm::Module &M,
6565
llvm::ModuleAnalysisManager &MAM);
66+
67+
static bool isRequired() { return true; }
6668
};
6769

6870
class SPIRVLowerMemmoveLegacy : public llvm::ModulePass,

llvm-spirv/lib/SPIRV/SPIRVLowerOCLBlocks.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class SPIRVLowerOCLBlocksPass
5353
public:
5454
llvm::PreservedAnalyses run(llvm::Module &M,
5555
llvm::ModuleAnalysisManager &MAM);
56+
57+
static bool isRequired() { return true; }
5658
};
5759

5860
class SPIRVLowerOCLBlocksLegacy : public llvm::ModulePass,

llvm-spirv/lib/SPIRV/SPIRVLowerSaddWithOverflow.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class SPIRVLowerSaddWithOverflowPass
6262
public:
6363
llvm::PreservedAnalyses run(llvm::Module &M,
6464
llvm::ModuleAnalysisManager &MAM);
65+
66+
static bool isRequired() { return true; }
6567
};
6668

6769
class SPIRVLowerSaddWithOverflowLegacy : public llvm::ModulePass,

llvm-spirv/lib/SPIRV/SPIRVRegularizeLLVM.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ class SPIRVRegularizeLLVMPass
116116
return runRegularizeLLVM(M) ? llvm::PreservedAnalyses::none()
117117
: llvm::PreservedAnalyses::all();
118118
}
119+
120+
static bool isRequired() { return true; }
119121
};
120122

121123
class SPIRVRegularizeLLVMLegacy : public llvm::ModulePass,

llvm-spirv/lib/SPIRV/SPIRVToOCL.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,8 @@ class SPIRVToOCL12Pass : public llvm::PassInfoMixin<SPIRVToOCL12Pass>,
380380
return runSPIRVToOCL(M) ? llvm::PreservedAnalyses::none()
381381
: llvm::PreservedAnalyses::all();
382382
}
383+
384+
static bool isRequired() { return true; }
383385
};
384386

385387
class SPIRVToOCL12Legacy : public SPIRVToOCL12Base, public SPIRVToOCLLegacy {
@@ -451,6 +453,8 @@ class SPIRVToOCL20Pass : public llvm::PassInfoMixin<SPIRVToOCL20Pass>,
451453
return runSPIRVToOCL(M) ? llvm::PreservedAnalyses::none()
452454
: llvm::PreservedAnalyses::all();
453455
}
456+
457+
static bool isRequired() { return true; }
454458
};
455459

456460
class SPIRVToOCL20Legacy : public SPIRVToOCLLegacy, public SPIRVToOCL20Base {

llvm-spirv/lib/SPIRV/SPIRVWriter.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ class LLVMToSPIRVPass : public PassInfoMixin<LLVMToSPIRVPass> {
274274
: llvm::PreservedAnalyses::all();
275275
}
276276

277+
static bool isRequired() { return true; }
278+
277279
private:
278280
SPIRVModule *SMod;
279281
};

0 commit comments

Comments
 (0)