diff options
| author | 2017-01-14 19:55:43 +0000 | |
|---|---|---|
| committer | 2017-01-14 19:55:43 +0000 | |
| commit | bd3306aecb3a15e8967143b8cdbbccf2b1b19b74 (patch) | |
| tree | 309a8132b44564b9e634c0da6815187ce8eab27c /gnu/llvm/lib/Target/X86/X86PadShortFunction.cpp | |
| parent | killp -a should not kill the window if only one pane. (diff) | |
| download | wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.tar.xz wireguard-openbsd-bd3306aecb3a15e8967143b8cdbbccf2b1b19b74.zip | |
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; |
