[llvm-dev] Error due to TBAA access tag not created by me

Alex Susu via llvm-dev llvm-dev at lists.llvm.org
Wed Apr 7 08:21:47 PDT 2021


   Hello.
     I get a strange error when I create a shufflevector instruction with the IRBuilder 
with the following standard code:
	  ...
           Value *shuffleVec = Builder.CreateShuffleVector(
                              src, // The 1st source vector
                              UndefValue::get(VectorTy_1), // The 2nd source vector - undef
                              ConstantVector::get(shuffleMask));

     The reason is that during code generation LLVM automatically adds by itself (haven't 
figured out where; I'm using LLVM version 9 from 2019) the TBAA attribute (from Type-Based 
Alias Analysis). And then, later, the LLVM verifier complains:
      <<This instruction shall not have a TBAA access tag!
        %5 = shufflevector <8 x i16> %4, <8 x i16> undef, <8 x i32> <i32 2, i32 %3, i32 4, 
i32 5, i32 6, i32 7, i32 0, i32 1>, !dbg !24, !tbaa !26>>
     and then opt (or llc) stops with error:
       <<LLVM ERROR: Broken function found, compilation aborted!>>

     So to be able to get rid of this TBAA tag I used:
           opt -disable-verify,
        and then I edited the .ll file generated and simply removed the TBAA tag.

     Could you please tell me if there is an easier way to get rid of these TBAA tags? For 
example, can we simply avoid to create these tags in the first place?

   Thank you very much,
     Alex


More information about the llvm-dev mailing list