summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorQuentin Colombet <qcolombet@apple.com>2016-05-20 17:36:54 +0000
committerQuentin Colombet <qcolombet@apple.com>2016-05-20 17:36:54 +0000
commita55301287494d75309f62a15c3d1b221b5e447a0 (patch)
tree9413c519b6c442e883c5681a4e37d93d4cb94673 /llvm/lib
parentb7fda4baa96e4175fd5fd1781ec4a6065fdf1526 (diff)
downloadbcm5719-llvm-a55301287494d75309f62a15c3d1b221b5e447a0.tar.gz
bcm5719-llvm-a55301287494d75309f62a15c3d1b221b5e447a0.zip
[RegBankSelect] Use the Fast mode for functions with the optnone attribute.
llvm-svn: 270242
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
index 9586223ac13..4a052ca84cb 100644
--- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp
@@ -16,6 +16,7 @@
#include "llvm/CodeGen/MachineBlockFrequencyInfo.h"
#include "llvm/CodeGen/MachineBranchProbabilityInfo.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
+#include "llvm/IR/Function.h"
#include "llvm/Support/BlockFrequency.h"
#include "llvm/Support/Debug.h"
#include "llvm/Target/TargetSubtargetInfo.h"
@@ -452,6 +453,10 @@ void RegBankSelect::assignInstr(MachineInstr &MI) {
bool RegBankSelect::runOnMachineFunction(MachineFunction &MF) {
DEBUG(dbgs() << "Assign register banks for: " << MF.getName() << '\n');
+ const Function *F = MF.getFunction();
+ Mode SaveOptMode = OptMode;
+ if (F->hasFnAttribute(Attribute::OptimizeNone))
+ OptMode = Mode::Fast;
init(MF);
// Walk the function and assign register banks to all operands.
// Use a RPOT to make sure all registers are assigned before we choose
@@ -464,6 +469,7 @@ bool RegBankSelect::runOnMachineFunction(MachineFunction &MF) {
for (MachineInstr &MI : *MBB)
assignInstr(MI);
}
+ OptMode = SaveOptMode;
return false;
}
OpenPOWER on IntegriCloud