forked from OSchip/llvm-project
[NVPTX] Fix some usages of CodeGenOpt::None.
NVPTXLowerKernelArgs is required for correctness, so it should not be guarded by CodeGenOpt::None. NVPTXPeephole is optimization only, so it should be skipped when CodeGenOpt::None. llvm-svn: 267619
This commit is contained in:
parent
e5030e85ea
commit
c1b9d47b3b
|
@ -181,7 +181,6 @@ void NVPTXPassConfig::addEarlyCSEOrGVNPass() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void NVPTXPassConfig::addAddressSpaceInferencePasses() {
|
void NVPTXPassConfig::addAddressSpaceInferencePasses() {
|
||||||
addPass(createNVPTXLowerKernelArgsPass(&getNVPTXTargetMachine()));
|
|
||||||
// NVPTXLowerKernelArgs emits alloca for byval parameters which can often
|
// NVPTXLowerKernelArgs emits alloca for byval parameters which can often
|
||||||
// be eliminated by SROA.
|
// be eliminated by SROA.
|
||||||
addPass(createSROAPass());
|
addPass(createSROAPass());
|
||||||
|
@ -235,6 +234,9 @@ void NVPTXPassConfig::addIRPasses() {
|
||||||
addPass(createNVPTXAssignValidGlobalNamesPass());
|
addPass(createNVPTXAssignValidGlobalNamesPass());
|
||||||
addPass(createGenericToNVVMPass());
|
addPass(createGenericToNVVMPass());
|
||||||
|
|
||||||
|
// NVPTXLowerKernelArgs is required for correctness and should be run right
|
||||||
|
// before the address space inference passes.
|
||||||
|
addPass(createNVPTXLowerKernelArgsPass(&getNVPTXTargetMachine()));
|
||||||
if (getOptLevel() != CodeGenOpt::None) {
|
if (getOptLevel() != CodeGenOpt::None) {
|
||||||
addAddressSpaceInferencePasses();
|
addAddressSpaceInferencePasses();
|
||||||
addStraightLineScalarOptimizationPasses();
|
addStraightLineScalarOptimizationPasses();
|
||||||
|
@ -273,11 +275,13 @@ bool NVPTXPassConfig::addInstSelector() {
|
||||||
|
|
||||||
void NVPTXPassConfig::addPostRegAlloc() {
|
void NVPTXPassConfig::addPostRegAlloc() {
|
||||||
addPass(createNVPTXPrologEpilogPass(), false);
|
addPass(createNVPTXPrologEpilogPass(), false);
|
||||||
|
if (getOptLevel() != CodeGenOpt::None) {
|
||||||
// NVPTXPrologEpilogPass calculates frame object offset and replace frame
|
// NVPTXPrologEpilogPass calculates frame object offset and replace frame
|
||||||
// index with VRFrame register. NVPTXPeephole need to be run after that and
|
// index with VRFrame register. NVPTXPeephole need to be run after that and
|
||||||
// will replace VRFrame with VRFrameLocal when possible.
|
// will replace VRFrame with VRFrameLocal when possible.
|
||||||
addPass(createNVPTXPeephole());
|
addPass(createNVPTXPeephole());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
|
FunctionPass *NVPTXPassConfig::createTargetRegisterAllocator(bool) {
|
||||||
return nullptr; // No reg alloc
|
return nullptr; // No reg alloc
|
||||||
|
|
Loading…
Reference in New Issue