[llvm-dev] How to inhibit jump table range check

Thomas Lively via llvm-dev llvm-dev at lists.llvm.org
Fri Jun 19 22:52:48 PDT 2020


Hi Brian,

I actually solved this exact problem for the upstream WebAssembly backend
in the last couple of weeks. I was originally going to use the
OmitRangeCheck field, but after prompting from my reviewers on
https://reviews.llvm.org/D80778 I ended up removing the range checks in the
backend instead. You can see the pass I added to do that here:
https://github.com/llvm/llvm-project/blob/master/llvm/lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp
I
think it probably wouldn't be too hard to adapt that pass to a different
backend, but feel free to reach out if you have any questions about it!

Best,

Thomas

On Fri, Jun 19, 2020 at 12:55 PM Bagel via llvm-dev <llvm-dev at lists.llvm.org>
wrote:

> I am working on a back end for an architecture whose jump via table
> instruction
> includes the range check.  Therefore I don't need the range check
> generated (in
> SelectionDAGBuilder ?).
>
> There appears to be a struct JumpTableHeader which contains a field
> OmitRangeCheck which, when true, does what I want.  However, there doesn't
> appear to be a mechanism for a back end to set it.
>
> Anyone have any ideas?
>
> Thanks,
> brian
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200619/5c55e1af/attachment.html>


More information about the llvm-dev mailing list