forked from OSchip/llvm-project
Add optimization bisect opt-in calls for NVPTX passes
Differential Revision: http://reviews.llvm.org/D19518 llvm-svn: 267635
This commit is contained in:
parent
4ff3cfb673
commit
87b10dd7b3
|
@ -266,7 +266,7 @@ bool NVPTXFavorNonGenericAddrSpaces::optimizeMemoryInstruction(Instruction *MI,
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NVPTXFavorNonGenericAddrSpaces::runOnFunction(Function &F) {
|
bool NVPTXFavorNonGenericAddrSpaces::runOnFunction(Function &F) {
|
||||||
if (DisableFavorNonGeneric)
|
if (DisableFavorNonGeneric || skipFunction(F))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
|
|
|
@ -50,6 +50,9 @@ NVPTXImageOptimizer::NVPTXImageOptimizer()
|
||||||
: FunctionPass(ID) {}
|
: FunctionPass(ID) {}
|
||||||
|
|
||||||
bool NVPTXImageOptimizer::runOnFunction(Function &F) {
|
bool NVPTXImageOptimizer::runOnFunction(Function &F) {
|
||||||
|
if (skipFunction(F))
|
||||||
|
return false;
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
InstrToDelete.clear();
|
InstrToDelete.clear();
|
||||||
|
|
||||||
|
|
|
@ -419,6 +419,9 @@ static unsigned joinAddressSpaces(unsigned AS1, unsigned AS2) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NVPTXInferAddressSpaces::runOnFunction(Function &F) {
|
bool NVPTXInferAddressSpaces::runOnFunction(Function &F) {
|
||||||
|
if (skipFunction(F))
|
||||||
|
return false;
|
||||||
|
|
||||||
// Collects all generic address expressions in postorder.
|
// Collects all generic address expressions in postorder.
|
||||||
std::vector<Value *> Postorder = collectGenericAddressExpressions(F);
|
std::vector<Value *> Postorder = collectGenericAddressExpressions(F);
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,9 @@ INITIALIZE_PASS(NVPTXLowerAlloca, "nvptx-lower-alloca",
|
||||||
// Main function for this pass.
|
// Main function for this pass.
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
bool NVPTXLowerAlloca::runOnBasicBlock(BasicBlock &BB) {
|
bool NVPTXLowerAlloca::runOnBasicBlock(BasicBlock &BB) {
|
||||||
|
if (skipBasicBlock(BB))
|
||||||
|
return false;
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
for (auto &I : BB) {
|
for (auto &I : BB) {
|
||||||
if (auto allocaInst = dyn_cast<AllocaInst>(&I)) {
|
if (auto allocaInst = dyn_cast<AllocaInst>(&I)) {
|
||||||
|
|
|
@ -125,6 +125,9 @@ static void CombineCVTAToLocal(MachineInstr &Root) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NVPTXPeephole::runOnMachineFunction(MachineFunction &MF) {
|
bool NVPTXPeephole::runOnMachineFunction(MachineFunction &MF) {
|
||||||
|
if (skipFunction(*MF.getFunction()))
|
||||||
|
return false;
|
||||||
|
|
||||||
bool Changed = false;
|
bool Changed = false;
|
||||||
// Loop over all of the basic blocks.
|
// Loop over all of the basic blocks.
|
||||||
for (auto &MBB : MF) {
|
for (auto &MBB : MF) {
|
||||||
|
|
Loading…
Reference in New Issue