[PATCH] D87631: [AVR] Fix global references to function symbols

Dylan McKay via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 30 07:28:27 PDT 2020


dylanmckay added inline comments.


================
Comment at: llvm/test/CodeGen/AVR/rust-trait-object.ll:5
+
+; Somewhat pruned test case from rustc using trait objects
+
----------------
Optional: It might be a good idea to post the version of the Rust compiler used if it's not too much hassle to dig that up again.


================
Comment at: llvm/test/CodeGen/AVR/rust-trait-object.ll:67
+
+; Function Attrs: argmemonly nounwind willreturn
+declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture) addrspace(1) #2
----------------
Drop unnecessary function attributes as I suspect they are not required to reproduce the issue


================
Comment at: llvm/test/CodeGen/AVR/rust-trait-object.ll:92
+; call uno_traitobject2::call_trait_object
+  %0 = call fastcc addrspace(1) i8 @"uno_traitobject2::call_trait_object::hb4ae93d54abda045"({}* nonnull align 1 %_6.sroa.0.0, [3 x i16]* noalias readonly align 1 dereferenceable(6) %.)
+  ret i8 %0
----------------
Avoid numeric variable names in LLVM tests as they make modfications to the test in the future more difficult as LLVM verifier requires that all numerical vars are defined in order, which makes insertion of new variables mid-function problematic.

There is an existing LLVM pass which can be used to do this automatically, although there are very few numbered variable names in the test already so it might be easier to fixup manually. In the past I've been recommended and used to good success is the [instnamer](http://llvm.org/docs/Passes.html#instnamer-assign-names-to-anonymous-instructions) pass, invokable via `opt -instnamer ...`, although it will strip out your `CHECK` lines.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87631



More information about the llvm-commits mailing list