[PATCH] D68633: [utils] InlineFunction: fix for debug info affecting optimizations

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 18 05:08:54 PDT 2019


bjope added a comment.

Thanks! I like this solution.

Moving focus to the test case. I've added a couple of suggestions for cleanup.



================
Comment at: llvm/test/Transforms/Inline/inline-skip-use-empty-alloca.ll:31
+define i16 @g() !dbg !33 {
+  ; CHECK-LABEL: g
+  ; CHECK: %a1.i = alloca i32
----------------
This can basically match any line containing the letter g. Is it possible to make a more complete match?
I also suggest to rename the functions here to something like @foo and @bar instead of @f and @g to get something that is easier to distinguish.


================
Comment at: llvm/test/Transforms/Inline/inline-skip-use-empty-alloca.ll:43
+; Function Attrs: argmemonly nounwind
+declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+
----------------
This declaration can be removed (same goes for the lifetime.end).

One trick is to do some cleanup of the test case by using  `opt -S -strip-dead-prototypes -strip-dead-debug-info` to both strip away dead prototypes as well as reducing the amount of unused metadata. Just notice that you have to add back the CHECK/RUN lines etc manually afterwards.


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

https://reviews.llvm.org/D68633





More information about the llvm-commits mailing list