[PATCH] D45926: Fix DISubprogram while extracting instructions out of function

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 23 08:58:02 PDT 2018


aprantl added a comment.

Looks generally good, some nitpicks inside.



================
Comment at: include/llvm/Transforms/Utils/Cloning.h:148
+                       ValueMaterializer *Materializer = nullptr,
+                       bool ExtractingFunctions = false);
 
----------------
Can you add an
 ```
enum {
  ExtractingFunctions = true;
  CloningIntoSameModule = false;
};
```

or something along those lines for better readability?


================
Comment at: test/Transforms/MergeSimilarFunc/merge-debug-info-2.ll:58
+bb:
+  %tmp = alloca %struct.snork*, align 8
+  %tmp1 = alloca %struct.snork*, align 8
----------------
Is there a reason why this function needs to have more than just a single instruction?


================
Comment at: test/Transforms/MergeSimilarFunc/merge-debug-info-2.ll:68
+  call void @llvm.lifetime.start.p0i8(i64 8, i8* %tmp5) #2, !dbg !34
+  %tmp6 = load %struct.snork*, %struct.snork** %tmp, align 8, !dbg !35, !tbaa !8
+  store %struct.snork* %tmp6, %struct.snork** %tmp1, align 8, !dbg !36, !tbaa !8
----------------
please delete all the !tbaa metadata it's just distracting and will make the test harder to update in the future.


================
Comment at: test/Transforms/MergeSimilarFunc/merge-debug-info-2.ll:85
+attributes #0 = { argmemonly nounwind }
+attributes #1 = { minsize nounwind optsize ssp 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"="cyclone" "target-features"="+crypto,+fp-armv8,+neon,-zcm,-zcz" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #2 = { nounwind }
----------------
please delete all non-essential attributes (everything in quotes).


https://reviews.llvm.org/D45926





More information about the llvm-commits mailing list