[PATCH] D34028: [Bitcode] Add thumb-mode to target-features in metadata loader.

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 26 09:17:28 PDT 2017


mehdi_amini added inline comments.


================
Comment at: lib/Bitcode/Reader/MetadataLoader.cpp:594
+    const Triple TT(TheModule.getTargetTriple());
+    if (TT.getArch() != Triple::thumb && TT.getArch() != Triple::thumbeb &&
+        TT.getArch() != Triple::arm && TT.getArch() != Triple::armeb)
----------------
fhahn wrote:
> javed.absar wrote:
> > maybe you should add isARMorThumb to ADT/Triple.h and use it, much like isPS4(), isAndroid etc?
> Maybe it would make sense to add an isThumb() and isARm() method to Triple. In particular, isThumb could be used at a couple of places. But ideally those checks should be replaced to use the ARMSubtargetFeatures.
This will be done for each and every function in the module, while this check could be done at the module level once. 
I kind of remember that building a Triple from a string isn't "free", but possible this is negligible in face of the cost of deserializing bitcode.


https://reviews.llvm.org/D34028





More information about the llvm-commits mailing list