[RISCV] Indirect branch generation in position independent code
authorSam Elliott <selliott@lowrisc.org>
Mon, 17 Aug 2020 11:25:45 +0000 (12:25 +0100)
committerSam Elliott <selliott@lowrisc.org>
Mon, 17 Aug 2020 12:09:26 +0000 (13:09 +0100)
commit5f9ecc5d857fa5d95f6ea36153be19db40576f8a
tree6f60290be37b90621062117e6810acdb2e6bffa0
parente0eb4f204a0ef48cff8fedc0cbc5be2c71fe2afe
[RISCV] Indirect branch generation in position independent code

This fixes the "Unable to insert indirect branch" fatal error sometimes
seen when generating position-independent code.

Patch by msizanoen1

Reviewed By: jrtc27

Differential Revision: https://reviews.llvm.org/D84833
llvm/lib/Target/RISCV/RISCVInstrInfo.cpp
llvm/lib/Target/RISCV/RISCVInstrInfo.td
llvm/test/CodeGen/RISCV/branch-relaxation.ll