diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-14 19:56:11 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2017-01-14 19:56:11 +0000 |
commit | ca82c85029ae0befb17bc14a4faa9f3d51dd72b3 (patch) | |
tree | 2df9dea922feef454abe6d1499112a4abc270079 /gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp | |
parent | 04c0d479b956b5e4f4e20ce989b95443aa03da0b (diff) |
Import LLVM 3.9.1 including clang and lld.
Diffstat (limited to 'gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp')
-rw-r--r-- | gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp b/gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp index 0f425e28fa7..62a9aafc2cf 100644 --- a/gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp +++ b/gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp @@ -55,6 +55,11 @@ namespace { bool runOnMachineFunction(MachineFunction &MF) override; + MachineFunctionProperties getRequiredProperties() const override { + return MachineFunctionProperties().set( + MachineFunctionProperties::Property::AllVRegsAllocated); + } + const char *getPassName() const override { return "X86 Atom pad short functions"; } @@ -93,6 +98,9 @@ FunctionPass *llvm::createX86PadShortFunctions() { /// runOnMachineFunction - Loop over all of the basic blocks, inserting /// NOOP instructions before early exits. bool PadShortFunc::runOnMachineFunction(MachineFunction &MF) { + if (skipFunction(*MF.getFunction())) + return false; + if (MF.getFunction()->optForSize()) { return false; } @@ -179,13 +187,11 @@ bool PadShortFunc::cyclesUntilReturn(MachineBasicBlock *MBB, unsigned int CyclesToEnd = 0; - for (MachineBasicBlock::iterator MBBI = MBB->begin(); - MBBI != MBB->end(); ++MBBI) { - MachineInstr *MI = MBBI; + for (MachineInstr &MI : *MBB) { // Mark basic blocks with a return instruction. Calls to other // functions do not count because the called function will be padded, // if necessary. - if (MI->isReturn() && !MI->isCall()) { + if (MI.isReturn() && !MI.isCall()) { VisitedBBs[MBB] = VisitedBBInfo(true, CyclesToEnd); Cycles += CyclesToEnd; return true; |