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

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 27 04:59:19 PDT 2017


fhahn marked an inline comment as done.
fhahn 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:
> mehdi_amini wrote:
> > 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.
> @mehdi_amini I've updated the patch to only instantiate Triple once.
@javed.absar I've opened D34682 which adds `isThumb` and `isARM` functions to the Triple class.


https://reviews.llvm.org/D34028





More information about the llvm-commits mailing list