[llvm] r260152 - [WebAssembly] Update the br_if instructions' operand orders to match the spec.
Dan Gohman via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 8 13:50:13 PST 2016
Author: djg
Date: Mon Feb 8 15:50:13 2016
New Revision: 260152
URL: http://llvm.org/viewvc/llvm-project?rev=260152&view=rev
Log:
[WebAssembly] Update the br_if instructions' operand orders to match the spec.
Modified:
llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp
llvm/trunk/test/CodeGen/WebAssembly/cfg-stackify.ll
llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td?rev=260152&r1=260151&r2=260152&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td Mon Feb 8 15:50:13 2016
@@ -16,12 +16,12 @@ let Defs = [ARGUMENTS] in {
let isBranch = 1, isTerminator = 1, hasCtrlDep = 1 in {
// The condition operand is a boolean value which WebAssembly represents as i32.
-def BR_IF : I<(outs), (ins I32:$cond, bb_op:$dst),
+def BR_IF : I<(outs), (ins bb_op:$dst, I32:$cond),
[(brcond I32:$cond, bb:$dst)],
- "br_if \t$cond, $dst">;
+ "br_if \t$dst, $cond">;
let isCodeGenOnly = 1 in
-def BR_UNLESS : I<(outs), (ins I32:$cond, bb_op:$dst), [],
- "br_unless\t$cond, $dst">;
+def BR_UNLESS : I<(outs), (ins bb_op:$dst, I32:$cond), [],
+ "br_unless\t$dst, $cond">;
let isBarrier = 1 in {
def BR : I<(outs), (ins bb_op:$dst),
[(br bb:$dst)],
@@ -32,9 +32,9 @@ def BR : I<(outs), (ins bb_op:$dst),
} // Defs = [ARGUMENTS]
def : Pat<(brcond (i32 (setne I32:$cond, 0)), bb:$dst),
- (BR_IF I32:$cond, bb_op:$dst)>;
+ (BR_IF bb_op:$dst, I32:$cond)>;
def : Pat<(brcond (i32 (seteq I32:$cond, 0)), bb:$dst),
- (BR_UNLESS I32:$cond, bb_op:$dst)>;
+ (BR_UNLESS bb_op:$dst, I32:$cond)>;
let Defs = [ARGUMENTS] in {
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp?rev=260152&r1=260151&r2=260152&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp Mon Feb 8 15:50:13 2016
@@ -107,22 +107,22 @@ bool WebAssemblyInstrInfo::AnalyzeBranch
if (HaveCond)
return true;
// If we're running after CFGStackify, we can't optimize further.
- if (!MI.getOperand(1).isMBB())
+ if (!MI.getOperand(0).isMBB())
return true;
Cond.push_back(MachineOperand::CreateImm(true));
- Cond.push_back(MI.getOperand(0));
- TBB = MI.getOperand(1).getMBB();
+ Cond.push_back(MI.getOperand(1));
+ TBB = MI.getOperand(0).getMBB();
HaveCond = true;
break;
case WebAssembly::BR_UNLESS:
if (HaveCond)
return true;
// If we're running after CFGStackify, we can't optimize further.
- if (!MI.getOperand(1).isMBB())
+ if (!MI.getOperand(0).isMBB())
return true;
Cond.push_back(MachineOperand::CreateImm(false));
- Cond.push_back(MI.getOperand(0));
- TBB = MI.getOperand(1).getMBB();
+ Cond.push_back(MI.getOperand(1));
+ TBB = MI.getOperand(0).getMBB();
HaveCond = true;
break;
case WebAssembly::BR:
@@ -177,11 +177,11 @@ unsigned WebAssemblyInstrInfo::InsertBra
assert(Cond.size() == 2 && "Expected a flag and a successor block");
if (Cond[0].getImm()) {
- BuildMI(&MBB, DL, get(WebAssembly::BR_IF)).addOperand(Cond[1]).addMBB(TBB);
+ BuildMI(&MBB, DL, get(WebAssembly::BR_IF)).addMBB(TBB).addOperand(Cond[1]);
} else {
BuildMI(&MBB, DL, get(WebAssembly::BR_UNLESS))
- .addOperand(Cond[1])
- .addMBB(TBB);
+ .addMBB(TBB)
+ .addOperand(Cond[1]);
}
if (!FBB)
return 1;
Modified: llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp?rev=260152&r1=260151&r2=260152&view=diff
==============================================================================
--- llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp (original)
+++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyLowerBrUnless.cpp Mon Feb 8 15:50:13 2016
@@ -66,7 +66,7 @@ bool WebAssemblyLowerBrUnless::runOnMach
if (MI->getOpcode() != WebAssembly::BR_UNLESS)
continue;
- unsigned Cond = MI->getOperand(0).getReg();
+ unsigned Cond = MI->getOperand(1).getReg();
bool Inverted = false;
// Attempt to invert the condition in place.
@@ -124,8 +124,8 @@ bool WebAssemblyLowerBrUnless::runOnMach
// delete the br_unless.
assert(Inverted);
BuildMI(MBB, MI, MI->getDebugLoc(), TII.get(WebAssembly::BR_IF))
- .addReg(Cond)
- .addOperand(MI->getOperand(1));
+ .addOperand(MI->getOperand(0))
+ .addReg(Cond);
MBB.erase(MI);
}
}
Modified: llvm/trunk/test/CodeGen/WebAssembly/cfg-stackify.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/cfg-stackify.ll?rev=260152&r1=260151&r2=260152&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/cfg-stackify.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/cfg-stackify.ll Mon Feb 8 15:50:13 2016
@@ -95,17 +95,17 @@ back:
; CHECK-LABEL: test2:
; CHECK-NOT: local
; CHECK: block{{$}}
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK: .LBB2_1:
-; CHECK: br_if ${{[0-9]+}}, 0{{$}}
+; CHECK: br_if 0, ${{[0-9]+}}{{$}}
; CHECK: .LBB2_2:
; CHECK: return{{$}}
; OPT-LABEL: test2:
; OPT-NOT: local
; OPT: block{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT: .LBB2_1:
-; OPT: br_if ${{[0-9]+}}, 0{{$}}
+; OPT: br_if 0, ${{[0-9]+}}{{$}}
; OPT: .LBB2_2:
; OPT: return{{$}}
define void @test2(double* nocapture %p, i32 %n) {
@@ -136,12 +136,12 @@ for.end:
; CHECK-LABEL: doublediamond:
; CHECK: block{{$}}
; CHECK-NEXT: block{{$}}
-; CHECK: br_if ${{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, ${{[^,]+}}{{$}}
; CHECK: br 1{{$}}
; CHECK: .LBB3_2:
; CHECK-NEXT: end_block{{$}}
; CHECK: block{{$}}
-; CHECK: br_if ${{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, ${{[^,]+}}{{$}}
; CHECK: br 1{{$}}
; CHECK: .LBB3_4:
; CHECK-NEXT: end_block{{$}}
@@ -152,9 +152,9 @@ for.end:
; OPT-LABEL: doublediamond:
; OPT: block{{$}}
; OPT-NEXT: block{{$}}
-; OPT: br_if ${{[^,]+}}, 0{{$}}
+; OPT: br_if 0, ${{[^,]+}}{{$}}
; OPT: block{{$}}
-; OPT: br_if ${{[^,]+}}, 0{{$}}
+; OPT: br_if 0, ${{[^,]+}}{{$}}
; OPT: br 1{{$}}
; OPT: .LBB3_4:
; OPT: .LBB3_5:
@@ -185,12 +185,12 @@ exit:
; CHECK-LABEL: triangle:
; CHECK: block{{$}}
-; CHECK: br_if $1, 0{{$}}
+; CHECK: br_if 0, $1{{$}}
; CHECK: .LBB4_2:
; CHECK: return ${{[0-9]+}}{{$}}
; OPT-LABEL: triangle:
; OPT: block{{$}}
-; OPT: br_if $1, 0{{$}}
+; OPT: br_if 0, $1{{$}}
; OPT: .LBB4_2:
; OPT: return ${{[0-9]+}}{{$}}
define i32 @triangle(i32* %p, i32 %a) {
@@ -209,7 +209,7 @@ exit:
; CHECK-LABEL: diamond:
; CHECK: block{{$}}
; CHECK: block{{$}}
-; CHECK: br_if $1, 0{{$}}
+; CHECK: br_if 0, $1{{$}}
; CHECK: br 1{{$}}
; CHECK: .LBB5_2:
; CHECK: .LBB5_3:
@@ -218,7 +218,7 @@ exit:
; OPT-LABEL: diamond:
; OPT: block{{$}}
; OPT: block{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT: br 1{{$}}
; OPT: .LBB5_2:
; OPT: .LBB5_3:
@@ -277,7 +277,7 @@ loop:
; CHECK-NOT: br
; CHECK: .LBB8_1:
; CHECK: loop{{$}}
-; CHECK: br_if $pop{{[0-9]+}}, 0{{$}}
+; CHECK: br_if 0, $pop{{[0-9]+}}{{$}}
; CHECK-NEXT: end_loop{{$}}
; CHECK: i32.const $push{{[0-9]+}}=, 0{{$}}
; CHECK-NEXT: return $pop{{[0-9]+}}{{$}}
@@ -285,7 +285,7 @@ loop:
; OPT-NOT: br
; OPT: .LBB8_1:
; OPT: loop{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NEXT: end_loop{{$}}
; OPT: i32.const $push{{[0-9]+}}=, 0{{$}}
; OPT-NEXT: return $pop{{[0-9]+}}{{$}}
@@ -304,17 +304,17 @@ exit:
; CHECK-LABEL: doubletriangle:
; CHECK: block{{$}}
-; CHECK: br_if $0, 0{{$}}
+; CHECK: br_if 0, $0{{$}}
; CHECK: block{{$}}
-; CHECK: br_if $1, 0{{$}}
+; CHECK: br_if 0, $1{{$}}
; CHECK: .LBB9_3:
; CHECK: .LBB9_4:
; CHECK: return ${{[0-9]+}}{{$}}
; OPT-LABEL: doubletriangle:
; OPT: block{{$}}
-; OPT: br_if $0, 0{{$}}
+; OPT: br_if 0, $0{{$}}
; OPT: block{{$}}
-; OPT: br_if $1, 0{{$}}
+; OPT: br_if 0, $1{{$}}
; OPT: .LBB9_3:
; OPT: .LBB9_4:
; OPT: return ${{[0-9]+}}{{$}}
@@ -341,18 +341,18 @@ exit:
; CHECK-LABEL: ifelse_earlyexits:
; CHECK: block{{$}}
; CHECK: block{{$}}
-; CHECK: br_if $0, 0{{$}}
+; CHECK: br_if 0, $0{{$}}
; CHECK: br 1{{$}}
; CHECK: .LBB10_2:
-; CHECK: br_if $1, 0{{$}}
+; CHECK: br_if 0, $1{{$}}
; CHECK: .LBB10_4:
; CHECK: i32.const $push{{[0-9]+}}=, 0{{$}}
; CHECK-NEXT: return $pop{{[0-9]+}}{{$}}
; OPT-LABEL: ifelse_earlyexits:
; OPT: block{{$}}
; OPT: block{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
-; OPT: br_if $1, 1{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
+; OPT: br_if 1, $1{{$}}
; OPT: br 1{{$}}
; OPT: .LBB10_3:
; OPT: .LBB10_4:
@@ -383,11 +383,11 @@ exit:
; CHECK: loop{{$}}
; CHECK: block{{$}}
; CHECK: block{{$}}
-; CHECK: br_if $0, 0{{$}}
+; CHECK: br_if 0, $0{{$}}
; CHECK: br 1{{$}}
; CHECK: .LBB11_3:
; CHECK: block{{$}}
-; CHECK: br_if $1, 0{{$}}
+; CHECK: br_if 0, $1{{$}}
; CHECK: br 1{{$}}
; CHECK: .LBB11_5:
; CHECK: .LBB11_6:
@@ -399,9 +399,9 @@ exit:
; OPT: loop{{$}}
; OPT: block{{$}}
; OPT: block{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT: block{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT: br 2{{$}}
; OPT: .LBB11_4:
; OPT-NEXT: end_block{{$}}
@@ -484,16 +484,16 @@ if.end:
; CHECK: block{{$}}
; CHECK-NEXT: block{{$}}
; CHECK-NEXT: block{{$}}
-; CHECK: br_if $pop{{[0-9]+}}, 0{{$}}
+; CHECK: br_if 0, $pop{{[0-9]+}}{{$}}
; CHECK-NEXT: block{{$}}
-; CHECK: br_if $pop{{[0-9]+}}, 0{{$}}
-; CHECK: br_if $pop{{[0-9]+}}, 2{{$}}
+; CHECK: br_if 0, $pop{{[0-9]+}}{{$}}
+; CHECK: br_if 2, $pop{{[0-9]+}}{{$}}
; CHECK-NEXT: .LBB13_3:
; CHECK-NEXT: end_block{{$}}
; CHECK-NEXT: return{{$}}
; CHECK-NEXT: .LBB13_4:
-; CHECK: br_if $pop{{[0-9]+}}, 1{{$}}
-; CHECK: br_if $pop{{[0-9]+}}, 0{{$}}
+; CHECK: br_if 1, $pop{{[0-9]+}}{{$}}
+; CHECK: br_if 0, $pop{{[0-9]+}}{{$}}
; CHECK-NEXT: return{{$}}
; CHECK-NEXT: .LBB13_7:
; CHECK-NEXT: end_block{{$}}
@@ -506,16 +506,16 @@ if.end:
; OPT: block{{$}}
; OPT-NEXT: block{{$}}
; OPT-NEXT: block{{$}}
-; OPT: br_if $pop{{[0-9]+}}, 0{{$}}
+; OPT: br_if 0, $pop{{[0-9]+}}{{$}}
; OPT-NEXT: block{{$}}
-; OPT: br_if $pop{{[0-9]+}}, 0{{$}}
-; OPT: br_if $pop{{[0-9]+}}, 2{{$}}
+; OPT: br_if 0, $pop{{[0-9]+}}{{$}}
+; OPT: br_if 2, $pop{{[0-9]+}}{{$}}
; OPT-NEXT: .LBB13_3:
; OPT-NEXT: end_block{{$}}
; OPT-NEXT: return{{$}}
; OPT-NEXT: .LBB13_4:
-; OPT: br_if $pop{{[0-9]+}}, 1{{$}}
-; OPT: br_if $pop{{[0-9]+}}, 0{{$}}
+; OPT: br_if 1, $pop{{[0-9]+}}{{$}}
+; OPT: br_if 0, $pop{{[0-9]+}}{{$}}
; OPT-NEXT: return{{$}}
; OPT-NEXT: .LBB13_7:
; OPT-NEXT: end_block{{$}}
@@ -552,8 +552,8 @@ default:
; CHECK: .LBB14_1:
; CHECK-NEXT: block{{$}}
; CHECK-NEXT: loop{{$}}
-; CHECK: br_if {{[^,]+}}, 2{{$}}
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 2, {{[^,]+}}{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NEXT: end_loop{{$}}
; CHECK: return{{$}}
; CHECK-NEXT: .LBB14_4:
@@ -562,8 +562,8 @@ default:
; OPT: .LBB14_1:
; OPT-NEXT: block{{$}}
; OPT-NEXT: loop{{$}}
-; OPT: br_if {{[^,]+}}, 2{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 2, {{[^,]+}}{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NEXT: end_loop{{$}}
; OPT: return{{$}}
; OPT-NEXT: .LBB14_4:
@@ -599,11 +599,11 @@ return:
; CHECK-NEXT: block{{$}}
; CHECK-NEXT: loop{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 3{{$}}
+; CHECK: br_if 3, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 2{{$}}
+; CHECK: br_if 2, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NEXT: end_loop{{$}}
; CHECK-NOT: block
; CHECK: return{{$}}
@@ -620,11 +620,11 @@ return:
; OPT-NEXT: block{{$}}
; OPT-NEXT: loop{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 3{{$}}
+; OPT: br_if 3, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 2{{$}}
+; OPT: br_if 2, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NEXT: end_loop{{$}}
; OPT-NOT: block
; OPT: return{{$}}
@@ -672,15 +672,15 @@ second:
; CHECK-NEXT: loop{{$}}
; CHECK-NOT: block
; CHECK: block{{$}}
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 1{{$}}
+; CHECK: br_if 1, {{[^,]+}}{{$}}
; CHECK-NOT: block
; CHECK: unreachable
; CHECK-NEXT: .LBB16_4:
; CHECK-NEXT: end_block{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NEXT: end_loop{{$}}
; CHECK-NOT: block
; CHECK: unreachable
@@ -690,15 +690,15 @@ second:
; OPT-NOT: block
; OPT: block{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 1{{$}}
+; OPT: br_if 1, {{[^,]+}}{{$}}
; OPT-NOT: block
; OPT: unreachable
; OPT-NEXT: .LBB16_4:
; OPT-NEXT: end_block{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NEXT: end_loop{{$}}
; OPT-NOT: block
; OPT: unreachable
@@ -735,14 +735,14 @@ u1:
; CHECK-NEXT: loop{{$}}
; CHECK-NEXT: block{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 1{{$}}
+; CHECK: br_if 1, {{[^,]+}}{{$}}
; CHECK-NEXT: .LBB17_3:
; CHECK-NEXT: end_block{{$}}
; CHECK-NEXT: loop{{$}}
; CHECK-NEXT: i32.const $push{{[^,]+}}, 0{{$}}
-; CHECK-NEXT: br_if {{[^,]+}}, 0{{$}}
+; CHECK-NEXT: br_if 0, {{[^,]+}}{{$}}
; CHECK-NEXT: br 2{{$}}
; CHECK-NEXT: .LBB17_4:
; OPT-LABEL: test8:
@@ -750,14 +750,14 @@ u1:
; OPT-NEXT: loop{{$}}
; OPT-NEXT: block{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 1{{$}}
+; OPT: br_if 1, {{[^,]+}}{{$}}
; OPT-NEXT: .LBB17_3:
; OPT-NEXT: end_block{{$}}
; OPT-NEXT: loop{{$}}
; OPT-NEXT: i32.const $push{{[^,]+}}, 0{{$}}
-; OPT-NEXT: br_if {{[^,]+}}, 0{{$}}
+; OPT-NEXT: br_if 0, {{[^,]+}}{{$}}
; OPT-NEXT: br 2{{$}}
; OPT-NEXT: .LBB17_4:
define i32 @test8() {
@@ -784,20 +784,20 @@ bb3:
; CHECK: .LBB18_1:
; CHECK-NEXT: loop{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 1{{$}}
+; CHECK: br_if 1, {{[^,]+}}{{$}}
; CHECK-NEXT: .LBB18_2:
; CHECK-NEXT: loop{{$}}
; CHECK-NOT: block
; CHECK: block{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 1{{$}}
+; CHECK: br_if 1, {{[^,]+}}{{$}}
; CHECK-NEXT: br 3{{$}}
; CHECK-NEXT: .LBB18_4:
; CHECK-NEXT: end_block{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NEXT: br 2{{$}}
; CHECK-NEXT: .LBB18_5:
; CHECK-NOT: block
@@ -806,20 +806,20 @@ bb3:
; OPT: .LBB18_1:
; OPT-NEXT: loop{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 1{{$}}
+; OPT: br_if 1, {{[^,]+}}{{$}}
; OPT-NEXT: .LBB18_2:
; OPT-NEXT: loop{{$}}
; OPT-NOT: block
; OPT: block{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 1{{$}}
+; OPT: br_if 1, {{[^,]+}}{{$}}
; OPT-NEXT: br 3{{$}}
; OPT-NEXT: .LBB18_4:
; OPT-NEXT: end_block{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NEXT: br 2{{$}}
; OPT-NEXT: .LBB18_5:
; OPT-NOT: block
@@ -862,7 +862,7 @@ end:
; CHECK: .LBB19_1:
; CHECK-NEXT: loop{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NEXT: .LBB19_2:
; CHECK-NEXT: block{{$}}
; CHECK-NEXT: loop{{$}}
@@ -870,7 +870,7 @@ end:
; CHECK: .LBB19_3:
; CHECK-NEXT: loop{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 5{{$}}
+; CHECK: br_if 5, {{[^,]+}}{{$}}
; CHECK-NOT: block
; CHECK: tableswitch {{[^,]+}}, 0, 0, 1, 5, 2, 4{{$}}
; CHECK-NEXT: .LBB19_5:
@@ -886,7 +886,7 @@ end:
; OPT: .LBB19_1:
; OPT-NEXT: loop{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NEXT: .LBB19_2:
; OPT-NEXT: block{{$}}
; OPT-NEXT: loop{{$}}
@@ -894,7 +894,7 @@ end:
; OPT: .LBB19_3:
; OPT-NEXT: loop{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 5{{$}}
+; OPT: br_if 5, {{[^,]+}}{{$}}
; OPT-NOT: block
; OPT: tableswitch {{[^,]+}}, 0, 0, 1, 5, 2, 4{{$}}
; OPT-NEXT: .LBB19_5:
@@ -948,12 +948,12 @@ bb6:
; CHECK-NEXT: block{{$}}
; CHECK-NEXT: block{{$}}
; CHECK-NEXT: block{{$}}
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NOT: block
; CHECK: block{{$}}
-; CHECK-NEXT: br_if {{[^,]+}}, 0{{$}}
+; CHECK-NEXT: br_if 0, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 2{{$}}
+; CHECK: br_if 2, {{[^,]+}}{{$}}
; CHECK-NEXT: .LBB20_3:
; CHECK-NEXT: end_block{{$}}
; CHECK-NOT: block
@@ -961,9 +961,9 @@ bb6:
; CHECK-NEXT: .LBB20_4:
; CHECK-NEXT: end_block{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 2{{$}}
+; CHECK: br_if 2, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 1{{$}}
+; CHECK: br_if 1, {{[^,]+}}{{$}}
; CHECK-NEXT: .LBB20_6:
; CHECK-NEXT: end_block{{$}}
; CHECK-NOT: block
@@ -979,12 +979,12 @@ bb6:
; OPT-LABEL: test11:
; OPT: block{{$}}
; OPT-NEXT: block{{$}}
-; OPT: br_if $pop{{[0-9]+}}, 0{{$}}
+; OPT: br_if 0, $pop{{[0-9]+}}{{$}}
; OPT-NOT: block
; OPT: block{{$}}
-; OPT-NEXT: br_if $0, 0{{$}}
+; OPT-NEXT: br_if 0, $0{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 2{{$}}
+; OPT: br_if 2, {{[^,]+}}{{$}}
; OPT-NEXT: .LBB20_3:
; OPT-NEXT: end_block{{$}}
; OPT-NOT: block
@@ -994,13 +994,13 @@ bb6:
; OPT-NOT: block
; OPT: block{{$}}
; OPT-NOT: block
-; OPT: br_if $pop{{[0-9]+}}, 0{{$}}
+; OPT: br_if 0, $pop{{[0-9]+}}{{$}}
; OPT-NOT: block
; OPT: return{{$}}
; OPT-NEXT: .LBB20_6:
; OPT-NEXT: end_block{{$}}
; OPT-NOT: block
-; OPT: br_if $pop{{[0-9]+}}, 0{{$}}
+; OPT: br_if 0, $pop{{[0-9]+}}{{$}}
; OPT-NOT: block
; OPT: return{{$}}
; OPT-NEXT: .LBB20_8:
@@ -1044,18 +1044,18 @@ bb8:
; CHECK: block{{$}}
; CHECK-NEXT: block{{$}}
; CHECK-NEXT: block{{$}}
-; CHECK: br_if {{[^,]+}}, 0{{$}}
+; CHECK: br_if 0, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 2{{$}}
+; CHECK: br_if 2, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 2{{$}}
+; CHECK: br_if 2, {{[^,]+}}{{$}}
; CHECK-NEXT: br 1{{$}}
; CHECK-NEXT: .LBB21_4:
; CHECK-NEXT: end_block{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 1{{$}}
+; CHECK: br_if 1, {{[^,]+}}{{$}}
; CHECK-NOT: block
-; CHECK: br_if {{[^,]+}}, 1{{$}}
+; CHECK: br_if 1, {{[^,]+}}{{$}}
; CHECK-NEXT: .LBB21_6:
; CHECK-NEXT: end_block{{$}}
; CHECK-NEXT: return{{$}}
@@ -1071,18 +1071,18 @@ bb8:
; OPT: block{{$}}
; OPT-NEXT: block{{$}}
; OPT-NEXT: block{{$}}
-; OPT: br_if {{[^,]+}}, 0{{$}}
+; OPT: br_if 0, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 2{{$}}
+; OPT: br_if 2, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 2{{$}}
+; OPT: br_if 2, {{[^,]+}}{{$}}
; OPT-NEXT: br 1{{$}}
; OPT-NEXT: .LBB21_4:
; OPT-NEXT: end_block{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 1{{$}}
+; OPT: br_if 1, {{[^,]+}}{{$}}
; OPT-NOT: block
-; OPT: br_if {{[^,]+}}, 1{{$}}
+; OPT: br_if 1, {{[^,]+}}{{$}}
; OPT-NEXT: .LBB21_6:
; OPT-NEXT: end_block{{$}}
; OPT-NEXT: return{{$}}
@@ -1121,33 +1121,33 @@ bb7:
; CHECK-LABEL: test13:
; CHECK-NEXT: .local i32{{$}}
; CHECK: block{{$}}
-; CHECK: br_if $pop5, 0{{$}}
+; CHECK: br_if 0, $pop5{{$}}
; CHECK-NEXT: return{{$}}
; CHECK-NEXT: .LBB22_2:
; CHECK-NEXT: end_block{{$}}
; CHECK: block{{$}}
; CHECK-NEXT: i32.const $push3=, 0{{$}}
-; CHECK-NEXT: br_if $pop3, 0{{$}}
+; CHECK-NEXT: br_if 0, $pop3{{$}}
; CHECK: .LBB22_4:
; CHECK-NEXT: end_block{{$}}
; CHECK: block{{$}}
-; CHECK: br_if $pop7, 0{{$}}
+; CHECK: br_if 0, $pop7{{$}}
; CHECK-NEXT: end_block{{$}}
; CHECK-NEXT: unreachable{{$}}
; OPT-LABEL: test13:
; OPT-NEXT: .local i32{{$}}
; OPT: block{{$}}
-; OPT: br_if $pop5, 0{{$}}
+; OPT: br_if 0, $pop5{{$}}
; OPT-NEXT: return{{$}}
; OPT-NEXT: .LBB22_2:
; OPT-NEXT: end_block{{$}}
; OPT: block{{$}}
; OPT-NEXT: i32.const $push3=, 0{{$}}
-; OPT-NEXT: br_if $pop3, 0{{$}}
+; OPT-NEXT: br_if 0, $pop3{{$}}
; OPT: .LBB22_4:
; OPT-NEXT: end_block{{$}}
; OPT: block{{$}}
-; OPT: br_if $pop7, 0{{$}}
+; OPT: br_if 0, $pop7{{$}}
; OPT-NEXT: end_block{{$}}
; OPT-NEXT: unreachable{{$}}
define void @test13() noinline optnone {
@@ -1174,13 +1174,13 @@ bb5:
; CHECK-NEXT: .LBB23_1:{{$}}
; CHECK-NEXT: loop{{$}}
; CHECK-NEXT: i32.const $push0=, 0{{$}}
-; CHECK-NEXT: br_if $pop0, 0{{$}}
+; CHECK-NEXT: br_if 0, $pop0{{$}}
; CHECK-NEXT: .LBB23_2:{{$}}
; CHECK-NEXT: end_loop{{$}}
; CHECK-NEXT: loop{{$}}
; CHECK-NEXT: i32.const $discard=, 0{{$}}
; CHECK-NEXT: i32.const $push1=, 0{{$}}
-; CHECK-NEXT: br_if $pop1, 0{{$}}
+; CHECK-NEXT: br_if 0, $pop1{{$}}
; CHECK-NEXT: end_loop{{$}}
; CHECK-NEXT: return{{$}}
define void @test14() {
Modified: llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll?rev=260152&r1=260151&r2=260152&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll (original)
+++ llvm/trunk/test/CodeGen/WebAssembly/reg-stackify.ll Mon Feb 8 15:50:13 2016
@@ -66,7 +66,7 @@ define i32 @yes1(i32* %q) {
; CHECK-NEXT: i32.xor $push7=, $pop5, $pop6{{$}}
; CHECK-NEXT: i32.const $push10=, 1{{$}}
; CHECK-NEXT: i32.ne $push8=, $pop7, $pop10{{$}}
-; CHECK-NEXT: br_if $pop8, 0{{$}}
+; CHECK-NEXT: br_if 0, $pop8{{$}}
; CHECK-NEXT: i32.const $push9=, 0{{$}}
; CHECK-NEXT: return $pop9{{$}}
; CHECK-NEXT: .LBB4_2:
@@ -99,9 +99,9 @@ false:
; CHECK-NEXT: i32.load $push0=, 0($2){{$}}
; CHECK-NEXT: tee_local $push3=, $3=, $pop0{{$}}
; CHECK-NEXT: i32.ge_u $push1=, $pop3, $1{{$}}
-; CHECK-NEXT: br_if $pop1, 0{{$}}
+; CHECK-NEXT: br_if 0, $pop1{{$}}
; CHECK-NEXT: i32.lt_u $push2=, $3, $0{{$}}
-; CHECK-NEXT: br_if $pop2, 0{{$}}
+; CHECK-NEXT: br_if 0, $pop2{{$}}
; CHECK-NEXT: i32.store $discard=, 0($2), $3{{$}}
; CHECK-NEXT: .LBB5_3:
; CHECK-NEXT: end_block{{$}}
More information about the llvm-commits
mailing list