[PATCH] D18226: Codegen: Tail-duplicate during placement.

David Li via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 12 13:48:12 PDT 2016


davidxl added inline comments.

================
Comment at: test/CodeGen/X86/tail-dup-repeat.ll:7
@@ +6,3 @@
+
+declare void @foo(i32* nocapture, i8* nocapture readonly, i8* nocapture readonly) local_unnamed_addr #0
+
----------------
Can this function's declaration be simplified? If the parameters are not necessary, remove them

================
Comment at: test/CodeGen/X86/tail-dup-repeat.ll:11
@@ +10,3 @@
+; CHECK-LABEL: repeated_tail_dup
+define void @repeated_tail_dup(i1 %a1, i1 %b1, i32** %a32pp, i32** %b32pp) local_unnamed_addr #0 {
+entry:
----------------
Clean up the parameters (shorten names etc)). Remove unnecessary attribute

================
Comment at: test/CodeGen/X86/tail-dup-repeat.ll:15
@@ +14,3 @@
+
+while.body154:                                    ; preds = %while.cond152.backedge, %entry
+  %str.0924 = phi i8* [ undef, %entry ], [ %str.0.be, %while.cond152.backedge ]
----------------
Please also clean up variable names and label names.

For label names, make them more meaningful. For instance, if a block is duplicated, the label for the block can be 'dup:'. For iterative tail dup, also name them in sequence numbers dup1, dup2 etc.  Others can be cleaned up suchas header, loopexit etc.

Some simple comments in the test case (where tail dup happens) is also helpful.


https://reviews.llvm.org/D18226





More information about the llvm-commits mailing list