llvm-project/llvm/lib/Target/ARM/MCTargetDesc
Peter Smith 6f36cd4d76 [ARM] Account for implicit IT when calculating inline asm size
When deciding if it is safe to optimize a conditional branch to a CBZ or
CBNZ the offsets of the BasicBlocks from the start of the function are
estimated. For inline assembly the generic getInlineAsmLength() function is
used to get a worst case estimate of the inline assembly by multiplying the
number of instructions by the max instruction size of 4 bytes. This
unfortunately doesn't take into account the generation of Thumb implicit IT
instructions. In edge cases such as when all the instructions in the block
are 4-bytes in size and there is an implicit IT then the size is
underestimated. This can cause an out of range CBZ or CBNZ to be generated.

The patch takes a conservative approach and assumes that every instruction
in the inline assembly block may have an implicit IT.

Fixes pr31805

Differential Revision: https://reviews.llvm.org/D52834

llvm-svn: 343960
2018-10-08 09:38:28 +00:00
..
ARMAddressingModes.h Fix typo in previous commit 2018-09-08 04:07:41 +00:00
ARMAsmBackend.cpp ARM-MachO: don't add Thumb bit for addend to non-external relocation. 2018-08-06 11:32:44 +00:00
ARMAsmBackend.h [MC] Pass MCSubtargetInfo to fixupNeedsRelaxation and applyFixup 2018-06-06 09:40:06 +00:00
ARMAsmBackendDarwin.h MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
ARMAsmBackendELF.h MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
ARMAsmBackendWinCOFF.h MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
ARMBaseInfo.h ARM: fix Thumb2 CodeGen for ldrex with folded frame-index. 2018-09-07 09:21:25 +00:00
ARMELFObjectWriter.cpp The initial .text section generated in object files was missing the 2018-09-06 22:09:31 +00:00
ARMELFStreamer.cpp [ARM] Emmit data symbol for constant pool data 2018-10-02 14:55:48 +00:00
ARMFixupKinds.h
ARMMCAsmInfo.cpp [ARM] Account for implicit IT when calculating inline asm size 2018-10-08 09:38:28 +00:00
ARMMCAsmInfo.h
ARMMCCodeEmitter.cpp Remove trailing space 2018-07-30 19:41:25 +00:00
ARMMCExpr.cpp Remove redundant includes from lib/Target/ARM. 2017-12-13 21:31:17 +00:00
ARMMCExpr.h
ARMMCTargetDesc.cpp MC: Change the streamer ctors to take an object writer instead of a stream. NFCI. 2018-05-18 18:26:45 +00:00
ARMMCTargetDesc.h MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
ARMMachORelocationInfo.cpp Remove redundant includes from lib/Target/ARM. 2017-12-13 21:31:17 +00:00
ARMMachObjectWriter.cpp MC: Separate creating a generic object writer from creating a target object writer. NFCI. 2018-05-21 19:20:29 +00:00
ARMTargetStreamer.cpp [Target] Untangle disassemblers 2018-09-10 12:53:46 +00:00
ARMUnwindOpAsm.cpp
ARMUnwindOpAsm.h
ARMWinCOFFObjectWriter.cpp ARM: correct the relocation type for `bl` on WoA 2018-09-13 04:55:08 +00:00
ARMWinCOFFStreamer.cpp MC: Change the streamer ctors to take an object writer instead of a stream. NFCI. 2018-05-18 18:26:45 +00:00
CMakeLists.txt List cpp file only once (was added in 147117 and 147117 as build fix each). 2018-04-23 13:11:51 +00:00
LLVMBuild.txt