[PATCH] D23195: [ARM] Add support for embedded position-independent code

Tim Northover via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 5 07:26:50 PDT 2016


t.p.northover added a comment.

A surprisingly simple addition!

I see you've skipped SjLj exceptions and stack guards support. I think this is fine, but could you put "unsupported" assertions in at least the stack guard code (*InstrInfo.cpp)? I have less worries about SjLj because no-one should be using that voluntarily anyway.

Similarly, could we have an assertion on non-ELF targets about RWPI (in getEffectiveRelocModel or something)? It looks to me like ROPI would work but MachO certainly doesn't have the required relocations for RWPI and if COFF has them, they're not supported yet.

You also seem to have no tests for the build attributes?


================
Comment at: test/CodeGen/ARM/arm-position-independence-jump-table.ll:3-7
@@ +2,7 @@
+
+; Why is each test run four times? Each run checks the correct generation of
+; the jump table and one of the leaf nodes. Checking all four in one run is 
+; too fragile as the labels in the table need not be in numerical order, but 
+; are always listed in the IR in numerical order meaning the ordering of the
+; leaves cannot be relied upon. 
+
----------------
Have you tried disabling machine block placement (-disable-block-placement) and/or other things that mess around with the code?

If that fails, it would be more efficient to only run llc once (to a temporary file) and then FileCheck that repeatedly:

    ; RUN: llc <whatever> -o %t
    ; RUN: FileCheck %s --check-prefix=Whatever < %t
    ...


Repository:
  rL LLVM

https://reviews.llvm.org/D23195





More information about the llvm-commits mailing list