[llvm] r356439 - [WebAssembly] Improve readability of irreducibility tests

Heejin Ahn via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 22:10:39 PDT 2019


Author: aheejin
Date: Mon Mar 18 22:10:39 2019
New Revision: 356439

URL: http://llvm.org/viewvc/llvm-project?rev=356439&view=rev
Log:
[WebAssembly] Improve readability of irreducibility tests

Summary:
This adds `preds` comment lines to BB names for readability, while also
fixes some of existing incorrect comment lines. Also deletes a few
unnecessary attributes. Autogenerated by `opt`.

Reviewers: kripken

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59456

Modified:
    llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg-exceptions.ll
    llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll

Modified: llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg-exceptions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg-exceptions.ll?rev=356439&r1=356438&r2=356439&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg-exceptions.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg-exceptions.ll Mon Mar 18 22:10:39 2019
@@ -11,98 +11,96 @@ declare i32 @__gxx_personality_v0(...)
 ; CHECK-LABEL: crashy:
 ; CHECK-NOT: br_table
 
-; Function Attrs: minsize noinline optsize
 define void @crashy() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
 entry:
   invoke void undef()
           to label %invoke.cont unwind label %lpad
 
-invoke.cont: ; preds = %entry
+invoke.cont:                                      ; preds = %entry
   invoke void undef()
           to label %invoke.cont4 unwind label %lpad3
 
-invoke.cont4: ; preds = %invoke.cont
+invoke.cont4:                                     ; preds = %invoke.cont
   %call.i82 = invoke i8* undef()
           to label %invoke.cont6 unwind label %lpad3
 
-invoke.cont6: ; preds = %invoke.cont4
+invoke.cont6:                                     ; preds = %invoke.cont4
   invoke void undef()
           to label %invoke.cont13 unwind label %lpad12
 
-invoke.cont13: ; preds = %invoke.cont6
+invoke.cont13:                                    ; preds = %invoke.cont6
   br label %for.cond
 
-for.cond: ; preds = %for.cond.backedge, %invoke.cont13
+for.cond:                                         ; preds = %for.cond.backedge, %invoke.cont13
   br i1 undef, label %exit2, label %land.lhs
 
-land.lhs: ; preds = %for.cond
+land.lhs:                                         ; preds = %for.cond
   %call.i.i.i.i92 = invoke i32 undef()
           to label %exit1 unwind label %lpad16.loopexit
 
-exit1: ; preds = %land.lhs
+exit1:                                            ; preds = %land.lhs
   br label %exit2
 
-exit2: ; preds = %exit1, %for.cond
+exit2:                                            ; preds = %exit1, %for.cond
   %call.i.i12.i.i93 = invoke i32 undef()
           to label %exit3 unwind label %lpad16.loopexit
 
-exit3: ; preds = %exit2
+exit3:                                            ; preds = %exit2
   invoke void undef()
           to label %invoke.cont23 unwind label %lpad22
 
-invoke.cont23: ; preds = %exit3
+invoke.cont23:                                    ; preds = %exit3
   invoke void undef()
           to label %invoke.cont25 unwind label %lpad22
 
-invoke.cont25: ; preds = %invoke.cont23
+invoke.cont25:                                    ; preds = %invoke.cont23
   %call.i.i137 = invoke i32 undef()
           to label %invoke.cont29 unwind label %lpad16.loopexit
 
-lpad: ; preds = %entry
+lpad:                                             ; preds = %entry
   %0 = landingpad { i8*, i32 }
           cleanup
   unreachable
 
-lpad3: ; preds = %invoke.cont4, %invoke.cont
+lpad3:                                            ; preds = %invoke.cont4, %invoke.cont
   %1 = landingpad { i8*, i32 }
           cleanup
   unreachable
 
-lpad12: ; preds = %invoke.cont6
+lpad12:                                           ; preds = %invoke.cont6
   %2 = landingpad { i8*, i32 }
           cleanup
   resume { i8*, i32 } undef
 
-lpad16.loopexit: ; preds = %if.then, %invoke.cont29, %invoke.cont25, %exit2, %land.lhs
+lpad16.loopexit:                                  ; preds = %if.then, %invoke.cont29, %invoke.cont25, %exit2, %land.lhs
   %lpad.loopexit = landingpad { i8*, i32 }
           cleanup
   unreachable
 
-lpad22: ; preds = %invoke.cont23, %exit3
+lpad22:                                           ; preds = %invoke.cont23, %exit3
   %3 = landingpad { i8*, i32 }
           cleanup
   unreachable
 
-invoke.cont29: ; preds = %invoke.cont25
+invoke.cont29:                                    ; preds = %invoke.cont25
   invoke void undef()
           to label %invoke.cont33 unwind label %lpad16.loopexit
 
-invoke.cont33: ; preds = %invoke.cont29
+invoke.cont33:                                    ; preds = %invoke.cont29
   br label %for.inc
 
-for.inc: ; preds = %invoke.cont33
+for.inc:                                          ; preds = %invoke.cont33
   %cmp.i.i141 = icmp eq i8* undef, undef
   br i1 %cmp.i.i141, label %if.then, label %if.end.i.i146
 
-if.then: ; preds = %for.inc
+if.then:                                          ; preds = %for.inc
   %call.i.i148 = invoke i32 undef()
           to label %for.cond.backedge unwind label %lpad16.loopexit
 
-for.cond.backedge: ; preds = %if.end.i.i146, %if.then
+for.cond.backedge:                                ; preds = %if.end.i.i146, %if.then
   br label %for.cond
 
-if.end.i.i146: ; preds = %for.inc
+if.end.i.i146:                                    ; preds = %for.inc
   call void undef()
   br label %for.cond.backedge
 }
-

Modified: llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll?rev=356439&r1=356438&r2=356439&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/irreducible-cfg.ll Mon Mar 18 22:10:39 2019
@@ -16,24 +16,24 @@ bb:
   %tmp = icmp eq i32 %arg2, 0
   br i1 %tmp, label %bb6, label %bb3
 
-bb3:
+bb3:                                              ; preds = %bb
   %tmp4 = getelementptr double, double* %arg, i32 %arg3
   %tmp5 = load double, double* %tmp4, align 4
   br label %bb13
 
-bb6:
+bb6:                                              ; preds = %bb13, %bb
   %tmp7 = phi i32 [ %tmp18, %bb13 ], [ 0, %bb ]
   %tmp8 = icmp slt i32 %tmp7, %arg1
   br i1 %tmp8, label %bb9, label %bb19
 
-bb9:
+bb9:                                              ; preds = %bb6
   %tmp10 = getelementptr double, double* %arg, i32 %tmp7
   %tmp11 = load double, double* %tmp10, align 4
   %tmp12 = fmul double %tmp11, 2.300000e+00
   store double %tmp12, double* %tmp10, align 4
   br label %bb13
 
-bb13:
+bb13:                                             ; preds = %bb9, %bb3
   %tmp14 = phi double [ %tmp5, %bb3 ], [ %tmp12, %bb9 ]
   %tmp15 = phi i32 [ undef, %bb3 ], [ %tmp7, %bb9 ]
   %tmp16 = getelementptr double, double* %arg, i32 %tmp15
@@ -42,7 +42,7 @@ bb13:
   %tmp18 = add nsw i32 %tmp15, 1
   br label %bb6
 
-bb19:
+bb19:                                             ; preds = %bb6
   ret void
 }
 
@@ -57,30 +57,30 @@ bb:
   %tmp = icmp eq i32 %arg2, 0
   br i1 %tmp, label %bb6, label %bb3
 
-bb3:
+bb3:                                              ; preds = %bb
   %tmp4 = getelementptr double, double* %arg, i32 %arg3
   %tmp5 = load double, double* %tmp4, align 4
   br label %bb13
 
-bb6:
+bb6:                                              ; preds = %bb13, %bb
   %tmp7 = phi i32 [ %tmp18, %bb13 ], [ 0, %bb ]
   %tmp8 = icmp slt i32 %tmp7, %arg1
   br i1 %tmp8, label %bb9, label %bb19
 
-bb9:
+bb9:                                              ; preds = %bb6
   %tmp10 = getelementptr double, double* %arg, i32 %tmp7
   %tmp11 = load double, double* %tmp10, align 4
   %tmp12 = fmul double %tmp11, 2.300000e+00
   store double %tmp12, double* %tmp10, align 4
   br label %bb10
 
-bb10:
+bb10:                                             ; preds = %bb10, %bb9
   %p = phi i32 [ 0, %bb9 ], [ %pn, %bb10 ]
   %pn = add i32 %p, 1
   %c = icmp slt i32 %pn, 256
   br i1 %c, label %bb10, label %bb13
 
-bb13:
+bb13:                                             ; preds = %bb10, %bb3
   %tmp14 = phi double [ %tmp5, %bb3 ], [ %tmp12, %bb10 ]
   %tmp15 = phi i32 [ undef, %bb3 ], [ %tmp7, %bb10 ]
   %tmp16 = getelementptr double, double* %arg, i32 %tmp15
@@ -89,7 +89,7 @@ bb13:
   %tmp18 = add nsw i32 %tmp15, 1
   br label %bb6
 
-bb19:
+bb19:                                             ; preds = %bb6
   ret void
 }
 
@@ -99,21 +99,21 @@ bb19:
 ; CHECK: br_if
 ; CHECK: i32.const $[[REG:[^,]+]]=
 ; CHECK: br_table  $[[REG]],
-define internal i32 @test2(i32) noinline {
+define i32 @test2(i32) {
 entry:
   br label %A0
 
-A0:
+A0:                                               ; preds = %entry
   %a0a = tail call i32 @test2(i32 1)
   %a0b = icmp eq i32 %a0a, 0
   br i1 %a0b, label %A1, label %A2
 
-A1:
+A1:                                               ; preds = %A2, %A1, %A0
   %a1a = tail call i32 @test2(i32 2)
   %a1b = icmp eq i32 %a1a, 0
   br i1 %a1b, label %A1, label %A2
 
-A2:
+A2:                                               ; preds = %A2, %A1, %A0
   %a2a = tail call i32 @test2(i32 3)
   %a2b = icmp eq i32 %a2a, 0
   br i1 %a2b, label %A1, label %A2
@@ -224,29 +224,29 @@ define void @ps_hints_apply() {
 entry:
   br label %psh
 
-psh:                                            ; preds = %entry
+psh:                                              ; preds = %entry
   br i1 undef, label %for.cond, label %for.body
 
-for.body:                                       ; preds = %psh
+for.body:                                         ; preds = %psh
   br label %do.body
 
-do.body:                                        ; preds = %do.cond, %for.body
+do.body:                                          ; preds = %do.cond, %for.body
   %cmp118 = icmp eq i32* undef, undef
   br i1 %cmp118, label %Skip, label %do.cond
 
-do.cond:                                        ; preds = %do.body
+do.cond:                                          ; preds = %do.body
   br label %do.body
 
-for.cond:                                       ; preds = %Skip, %psh
+for.cond:                                         ; preds = %Skip, %psh
   br label %for.body39
 
-for.body39:                                     ; preds = %for.cond
+for.body39:                                       ; preds = %for.cond
   br i1 undef, label %Skip, label %do.body45
 
-do.body45:                                      ; preds = %for.body39
+do.body45:                                        ; preds = %for.body39
   unreachable
 
-Skip:                                           ; preds = %for.body39, %do.body
+Skip:                                             ; preds = %for.body39, %do.body
   br label %for.cond
 }
 
@@ -255,20 +255,20 @@ Skip:
 ; CHECK: fannkuch_worker
 ; CHECK-NOT: br_table
 define i32 @fannkuch_worker(i8* %_arg) {
-for.cond:                                         ; preds = %entry
+for.cond:
   br label %do.body
 
 do.body:                                          ; preds = %do.cond, %for.cond
   br label %for.cond1
 
-for.cond1:                                        ; preds = %for.body, %do.body
-  br i1 1, label %for.cond1, label %for.end
+for.cond1:                                        ; preds = %for.cond1, %do.body
+  br i1 true, label %for.cond1, label %for.end
 
 for.end:                                          ; preds = %for.cond1
   br label %do.cond
 
 do.cond:                                          ; preds = %for.end
-  br i1 1, label %do.body, label %do.end
+  br i1 true, label %do.body, label %do.end
 
 do.end:                                           ; preds = %do.cond
   br label %for.cond2
@@ -276,8 +276,8 @@ do.end:
 for.cond2:                                        ; preds = %for.end6, %do.end
   br label %for.cond3
 
-for.cond3:                                        ; preds = %for.body5, %for.cond2
-  br i1 1, label %for.cond3, label %for.end6
+for.cond3:                                        ; preds = %for.cond3, %for.cond2
+  br i1 true, label %for.cond3, label %for.end6
 
 for.end6:                                         ; preds = %for.cond3
   br label %for.cond2




More information about the llvm-commits mailing list