diff options
author | Nick Desaulniers <ndesaulniers@google.com> | 2019-05-24 18:58:21 +0000 |
---|---|---|
committer | Nick Desaulniers <ndesaulniers@google.com> | 2019-05-24 18:58:21 +0000 |
commit | 9f7bd71cf581c67538bec0cf38ae33398edde83b (patch) | |
tree | e6460d68695af995eae505fdae2b54851f7b9b13 /llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | |
parent | 93d2c8a646c50f5b8be4d212c23ecc4533465aa5 (diff) | |
download | bcm5719-llvm-9f7bd71cf581c67538bec0cf38ae33398edde83b.tar.gz bcm5719-llvm-9f7bd71cf581c67538bec0cf38ae33398edde83b.zip |
[ARM] additionally check for ARM::INLINEASM_BR w/ ARM::INLINEASM
Summary:
We were observing failures for arm32 allyesconfigs of the Linux kernel
with the asm goto Clang patch, where ldr's were being generated to
offsets too far away to encode in imm12.
It looks like since INLINEASM_BR was created off of INLINEASM, a few
checks for INLINEASM needed to be updated to check for either case.
pr/41999
Link: https://github.com/ClangBuiltLinux/linux/issues/490
Reviewers: peter.smith, kristof.beyls, ostannard, rengolin, t.p.northover
Reviewed By: peter.smith
Subscribers: jyu2, javed.absar, hiraditya, llvm-commits, nathanchance, craig.topper, kees, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D62400
llvm-svn: 361659
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp index b55af47d7db..22c53d9e26c 100644 --- a/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp +++ b/llvm/lib/Target/ARM/ARMBaseInstrInfo.cpp @@ -706,15 +706,7 @@ unsigned ARMBaseInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const { if (MCID.getSize()) return MCID.getSize(); - // If this machine instr is an inline asm, measure it. - if (MI.getOpcode() == ARM::INLINEASM) { - unsigned Size = getInlineAsmLength(MI.getOperand(0).getSymbolName(), *MAI); - if (!MF->getInfo<ARMFunctionInfo>()->isThumbFunction()) - Size = alignTo(Size, 4); - return Size; - } - unsigned Opc = MI.getOpcode(); - switch (Opc) { + switch (MI.getOpcode()) { default: // pseudo-instruction sizes are zero. return 0; @@ -751,6 +743,14 @@ unsigned ARMBaseInstrInfo::getInstSizeInBytes(const MachineInstr &MI) const { return 12; case ARM::SPACE: return MI.getOperand(1).getImm(); + case ARM::INLINEASM: + case ARM::INLINEASM_BR: { + // If this machine instr is an inline asm, measure it. + unsigned Size = getInlineAsmLength(MI.getOperand(0).getSymbolName(), *MAI); + if (!MF->getInfo<ARMFunctionInfo>()->isThumbFunction()) + Size = alignTo(Size, 4); + return Size; + } } } @@ -2392,7 +2392,7 @@ bool llvm::rewriteARMFrameIndex(MachineInstr &MI, unsigned FrameRegIdx, bool isSub = false; // Memory operands in inline assembly always use AddrMode2. - if (Opcode == ARM::INLINEASM) + if (Opcode == ARM::INLINEASM || Opcode == ARM::INLINEASM_BR) AddrMode = ARMII::AddrMode2; if (Opcode == ARM::ADDri) { |