diff options
author | Evandro Menezes <e.menezes@samsung.com> | 2019-04-03 21:27:03 +0000 |
---|---|---|
committer | Evandro Menezes <e.menezes@samsung.com> | 2019-04-03 21:27:03 +0000 |
commit | 7c711ccf36e0a818f76d711715956ffe831f53b6 (patch) | |
tree | cfbd36f2d353a8c2eed5a47196fb39821ac5ec1f /llvm/lib/CodeGen | |
parent | 4d50879d9c93cdadfd6b0918931907c821d06520 (diff) | |
download | bcm5719-llvm-7c711ccf36e0a818f76d711715956ffe831f53b6.tar.gz bcm5719-llvm-7c711ccf36e0a818f76d711715956ffe831f53b6.zip |
[IR] Create new method in `Function` class (NFC)
Create method `optForNone()` testing for the function level equivalent of
`-O0` and refactor appropriately.
Differential revision: https://reviews.llvm.org/D59852
llvm-svn: 357638
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp | 4 | ||||
-rw-r--r-- | llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp index 9bce1c42757..6693fe4a653 100644 --- a/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp @@ -1341,8 +1341,8 @@ void CodeViewDebug::beginFunctionImpl(const MachineFunction *MF) { FPO |= FrameProcedureOptions::SecurityChecks; FPO |= FrameProcedureOptions(uint32_t(CurFn->EncodedLocalFramePtrReg) << 14U); FPO |= FrameProcedureOptions(uint32_t(CurFn->EncodedParamFramePtrReg) << 16U); - if (Asm->TM.getOptLevel() != CodeGenOpt::None && !GV.optForSize() && - !GV.hasFnAttribute(Attribute::OptimizeNone)) + if (Asm->TM.getOptLevel() != CodeGenOpt::None && + !GV.optForSize() && !GV.optForNone()) FPO |= FrameProcedureOptions::OptimizedForSpeed; // FIXME: Set GuardCfg when it is implemented. CurFn->FrameProcOpts = FPO; diff --git a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp index bd66d82e9b1..250a1db0666 100644 --- a/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/RegBankSelect.cpp @@ -657,7 +657,7 @@ bool RegBankSelect::runOnMachineFunction(MachineFunction &MF) { LLVM_DEBUG(dbgs() << "Assign register banks for: " << MF.getName() << '\n'); const Function &F = MF.getFunction(); Mode SaveOptMode = OptMode; - if (F.hasFnAttribute(Attribute::OptimizeNone)) + if (F.optForNone()) OptMode = Mode::Fast; init(MF); diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index f792fc6db91..fc110c683f4 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -728,7 +728,7 @@ void SafeStack::TryInlinePointerAddress() { if (!isa<CallInst>(UnsafeStackPtr)) return; - if(F.hasFnAttribute(Attribute::OptimizeNone)) + if(F.optForNone()) return; CallSite CS(UnsafeStackPtr); |