[PATCH] D59002: Use bitset for assembler predicates

Stanislav Mekhanoshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 7 11:59:26 PST 2019


rampitec added inline comments.


================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:10598
 } Extensions[] = {
-  { ARM::AEK_CRC, Feature_HasV8, {ARM::FeatureCRC} },
-  { ARM::AEK_CRYPTO,  Feature_HasV8,
+  { ARM::AEK_CRC, {Feature_HasV8Bit}, {ARM::FeatureCRC} },
+  { ARM::AEK_CRYPTO,  {Feature_HasV8Bit},
----------------
craig.topper wrote:
> This invokes the std::initializer_list constructor in FeatureBitset that can't be evaluated at compile time. Thus this is calling a static global constructor.
> 
> I just recently fixed this issue in the *GenSubtargetInfo.inc files
I understand the concern, but use of FeatureBitArray makes it very dangerous for manual initialization since it does not provide any symbolic names for the initializers. If an individual bit will move to another dword it will start silently malfunction.

So far I have moved the array inside the consuming function in a hope that a smart compiler can postpone actual initialization until the first use, which may never happen. I suppose a best solution would be to change it when the above FIXME is resolved, so that this array will be auto generated by tablegen.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59002/new/

https://reviews.llvm.org/D59002





More information about the llvm-commits mailing list