Skip to content

Commit a682bb3

Browse files
authored
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.
1 parent 1f9a8fb commit a682bb3

11 files changed

+24
-0
lines changed

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

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

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
};

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,

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

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,

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,

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,

lib/SPIRV/SPIRVRegularizeLLVM.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ class SPIRVRegularizeLLVMPass
122122
return runRegularizeLLVM(M) ? llvm::PreservedAnalyses::none()
123123
: llvm::PreservedAnalyses::all();
124124
}
125+
126+
static bool isRequired() { return true; }
125127
};
126128

127129
class SPIRVRegularizeLLVMLegacy : public llvm::ModulePass,

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 {

lib/SPIRV/SPIRVWriter.h

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

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

0 commit comments

Comments
 (0)