[PATCH] D27499: CFI-icall on Thumb

Peter Collingbourne via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 7 16:25:11 PST 2016


pcc accepted this revision.
pcc added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: lib/Transforms/IPO/LowerTypeTests.cpp:654
     default:
       report_fatal_error("Unsupported architecture for jump tables");
   }
----------------
eugenis wrote:
> pcc wrote:
> > I suspect that we will want to land here for thumbv5, at least until/unless we have an implementation of jump tables for that architecture.
> How do I detect thumb2 (that's what this code actually depends on)?
> I don't see a way to access TargetMachine from here, and the triple alone is not enough (e.g. -mcpu=cortex-a8 enables thumb2).
It does appear to be complicated.

Basically it looks like we will want to look up the "target-cpu" function attribute on each function in the jump table, and make sure that each target-cpu inherits the "thumb2" target feature. The backend implements some of that, but it isn't being exposed to the midend.

For the moment I think we will have to rely on the assembler rejecting the "b.w" instruction on thumb1 targets.


Repository:
  rL LLVM

https://reviews.llvm.org/D27499





More information about the llvm-commits mailing list