[llvm-dev] Look up table in function section
Tim Northover via llvm-dev
llvm-dev at lists.llvm.org
Thu May 4 11:51:41 PDT 2017
On 4 May 2017 at 11:08, Friedman, Eli via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> In terms of putting IR globals into a function, the only precedent I can
> think of is the arm-constant-promote transform.
Jump table location is configurable for the generic case too
(obviously, assuming an IR pass hasn't already made that decision for
you). The callback is
TargetLoweringObjectFile::shouldPutJumpTableInFunctionSection, and I
believe that just puts the tables at the end of a function.
It's not usually that useful though: more gadgets to exploit and in
the RISCy targets I know of you still have to address them as a
full-on global to ensure they're in range.
If at all possible, I wouldn't recommend going the ARMConstantIslands
route and putting the tables in the middle of a function. That pass is
a constant source of bugs.
Tim.
More information about the llvm-dev
mailing list