ARM: Add GPR register class excluding LR for use with the ADR instruction.
authorTilmann Scheller <tilmann.scheller@googlemail.com>
Thu, 5 Sep 2013 11:10:31 +0000 (11:10 +0000)
committerTilmann Scheller <tilmann.scheller@googlemail.com>
Thu, 5 Sep 2013 11:10:31 +0000 (11:10 +0000)
commita1787a58350d45c61e4586cbe1cb8271572f0496
tree96a937da380e40b12dd409bd35ae82e62725da82
parentf3a5d004915bf70a32359d45d043a4197dc4c20d
ARM: Add GPR register class excluding LR for use with the ADR instruction.

This improves code generation for jump tables by avoiding the emission of "mov pc, lr" which could fool the processor into believing this is a return from a function causing mispredicts. The code generation logic for jump tables uses ADR to materialize the address of the jump target.

Patch by Daniel Stewart!

llvm-svn: 190043
llvm/lib/Target/ARM/ARMInstrThumb2.td
llvm/lib/Target/ARM/ARMRegisterInfo.td
llvm/lib/Target/ARM/Thumb2InstrInfo.cpp
llvm/test/CodeGen/ARM/2013-09-04-Thumb2JumpTable.ll [new file with mode: 0644]