diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-11-19 06:37:03 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-11-19 06:37:03 +0000 |
commit | 1070c0a33692cb38ba23efd11ff3116f2fc33834 (patch) | |
tree | 56e69627d6525c644b16ff01dedca41285f0d410 /lib/Target/X86/X86InstrInfo.cpp | |
parent | 72ef53ad21cf2df7cdf6f2a0470b4eaa98d9e7ed (diff) | |
download | external_llvm-1070c0a33692cb38ba23efd11ff3116f2fc33834.zip external_llvm-1070c0a33692cb38ba23efd11ff3116f2fc33834.tar.gz external_llvm-1070c0a33692cb38ba23efd11ff3116f2fc33834.tar.bz2 |
Merging r195094:
------------------------------------------------------------------------
r195094 | atrick | 2013-11-18 19:29:59 -0800 (Mon, 18 Nov 2013) | 3 lines
Use symbolic operands in the patchpoint folding routine and fix a spilling bug.
Fixes <rdar://15487687> [JS] AnyRegCC argument ends up being spilled
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195113 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86InstrInfo.cpp')
-rw-r--r-- | lib/Target/X86/X86InstrInfo.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Target/X86/X86InstrInfo.cpp b/lib/Target/X86/X86InstrInfo.cpp index d0dfb80..2461773 100644 --- a/lib/Target/X86/X86InstrInfo.cpp +++ b/lib/Target/X86/X86InstrInfo.cpp @@ -4203,19 +4203,17 @@ static MachineInstr* foldPatchpoint(MachineFunction &MF, const SmallVectorImpl<unsigned> &Ops, int FrameIndex, const TargetInstrInfo &TII) { - bool hasDef = MI->getOperand(0).isReg() && MI->getOperand(0).isDef() && - !MI->getOperand(0).isImplicit(); - unsigned StartIdx = hasDef ? 1 : 0; - + unsigned StartIdx = 0; switch (MI->getOpcode()) { case TargetOpcode::STACKMAP: - StartIdx += 2; // Skip ID, nShadowBytes. + StartIdx = 2; // Skip ID, nShadowBytes. break; - case TargetOpcode::PATCHPOINT: - // Skip ID, numBytes, Target, numArgs. + case TargetOpcode::PATCHPOINT: { // For PatchPoint, the call args are not foldable. - StartIdx += MI->getOperand(StartIdx+3).getImm() + 4; + PatchPointOpers opers(MI); + StartIdx = opers.getVarIdx(); break; + } default: llvm_unreachable("unexpected stackmap opcode"); } |