[PATCH] D28075: MergeFunctions: Preserve debug info in thunks, under option -mergefunc-preserve-debug-info

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 26 13:55:39 PST 2016


fhahn added a comment.

Thanks for your patch! It's not my area of expertise but I think the size of the test case could be reduced quite a bit.



================
Comment at: test/Transforms/MergeFunc/thunk-debugability.ll:23
+; Function Attrs: nounwind uwtable
+define i32 @dotSumA(i32* %r, i32* %p, i32* %q, i32 %size) #0 !dbg !6 {
+entry:
----------------
Could the size of the dotSumA an dotSumA be reduced and still illustrate the problem?


================
Comment at: test/Transforms/MergeFunc/thunk-debugability.ll:225
+; Function Attrs: nounwind uwtable
+define i32 @main() #0 !dbg !136 {
+entry:
----------------
Could the function here just take a, b and c as parameters to make it simple? Also, do we need the debug intrinsics here?


================
Comment at: test/Transforms/MergeFunc/thunk-debugability.ll:259
+; Function Attrs: argmemonly nounwind
+declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #2
+
----------------
Can we get rid of this?


================
Comment at: test/Transforms/MergeFunc/thunk-debugability.ll:261
+
+attributes #0 = { nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind readnone }
----------------
I think you don't need attributes for the test case.


================
Comment at: test/Transforms/MergeFunc/thunk-debugability.ll:269
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 4.0.0 (http://llvm.org/git/clang.git 5cc8e8e46cffb91599efc751efa20c6bdf350884) (http://llvm.org/git/llvm.git eaf3712d06ee4d2eb53e908cdc6d08365adb7b08)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
+!1 = !DIFile(filename: "thunk-debugability.c", directory: "/auto/compiler-migration/anmparal/code/upstreaming/MFI")
----------------
You should be able to get rid of most of the debug metadata I think.


================
Comment at: test/Transforms/MergeFunc/thunk-debugability.ll:435
+
+; thunk-debugability.c:
+;
----------------
I think people tend to stick that at the top of the file (after the RUN lines)


================
Comment at: test/Transforms/MergeFunc/thunk-debugability.ll:476
+
+; thunk-debugability-aux.c
+;
----------------
It looks like this is not part of the test file.


https://reviews.llvm.org/D28075





More information about the llvm-commits mailing list