aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2013-11-21 20:18:40 +0000
committerBill Wendling <isanbard@gmail.com>2013-11-21 20:18:40 +0000
commit54075bbea7e70fea6cdb9e5e89b066118c1d314b (patch)
treee75c0a378f234ff9e3f38c2cd2b57d6e439d7487 /lib/CodeGen
parent11d31dff58dbe94423478d731cb81677d2fe4b7c (diff)
downloadexternal_llvm-54075bbea7e70fea6cdb9e5e89b066118c1d314b.zip
external_llvm-54075bbea7e70fea6cdb9e5e89b066118c1d314b.tar.gz
external_llvm-54075bbea7e70fea6cdb9e5e89b066118c1d314b.tar.bz2
Merging r195339:
------------------------------------------------------------------------ r195339 | chapuni | 2013-11-21 02:55:15 -0800 (Thu, 21 Nov 2013) | 5 lines Revert r195317 (and r195333), "Teach ISel not to optimize 'optnone' functions." It broke, at least, i686 target. It is reproducible with "llc -mtriple=i686-unknown". FYI, it didn't appear to add either "-O0" or "-fast-isel". ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp41
1 files changed, 1 insertions, 40 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 1372169..8bf8756 100644
--- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -223,39 +223,6 @@ defaultListDAGScheduler("default", "Best scheduler for the target",
namespace llvm {
//===--------------------------------------------------------------------===//
- /// \brief This struct is used by SelectionDAGISel to temporarily override
- /// the optimization level on a per-function basis.
- class OptLevelChanger {
- SelectionDAGISel &IS;
- CodeGenOpt::Level SavedOptLevel;
-
- public:
- OptLevelChanger(SelectionDAGISel &ISel,
- CodeGenOpt::Level NewOptLevel) : IS(ISel) {
- SavedOptLevel = IS.OptLevel;
- if (NewOptLevel == SavedOptLevel)
- return;
- IS.OptLevel = NewOptLevel;
- IS.TM.setOptLevel(NewOptLevel);
- DEBUG(dbgs() << "\nChanging optimization level for Function "
- << IS.MF->getFunction()->getName() << "\n");
- DEBUG(dbgs() << "\tBefore: -O" << SavedOptLevel
- << " ; After: -O" << NewOptLevel << "\n");
- }
-
- ~OptLevelChanger() {
- if (IS.OptLevel == SavedOptLevel)
- return;
- DEBUG(dbgs() << "\nRestoring optimization level for Function "
- << IS.MF->getFunction()->getName() << "\n");
- DEBUG(dbgs() << "\tBefore: -O" << IS.OptLevel
- << " ; After: -O" << SavedOptLevel << "\n");
- IS.OptLevel = SavedOptLevel;
- IS.TM.setOptLevel(SavedOptLevel);
- }
- };
-
- //===--------------------------------------------------------------------===//
/// createDefaultScheduler - This creates an instruction scheduler appropriate
/// for the target.
ScheduleDAGSDNodes* createDefaultScheduler(SelectionDAGISel *IS,
@@ -402,12 +369,6 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) {
ST.resetSubtargetFeatures(MF);
TM.resetTargetOptions(MF);
- // Reset OptLevel to None for optnone functions.
- CodeGenOpt::Level NewOptLevel = OptLevel;
- if (Fn.hasFnAttribute(Attribute::OptimizeNone))
- NewOptLevel = CodeGenOpt::None;
- OptLevelChanger OLC(*this, NewOptLevel);
-
DEBUG(dbgs() << "\n\n\n=== " << Fn.getName() << "\n");
SplitCriticalSideEffectEdges(const_cast<Function&>(Fn), this);
@@ -985,7 +946,7 @@ static void collectFailStats(const Instruction *I) {
void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
// Initialize the Fast-ISel state, if needed.
FastISel *FastIS = 0;
- if (TM.Options.EnableFastISel || Fn.hasFnAttribute(Attribute::OptimizeNone))
+ if (TM.Options.EnableFastISel)
FastIS = getTargetLowering()->createFastISel(*FuncInfo, LibInfo);
// Iterate over all basic blocks in the function.