summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td4
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp8
2 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
index af73a93c207..dd63e98efe9 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
@@ -13,9 +13,9 @@
//===----------------------------------------------------------------------===//
let isBranch = 1, isTerminator = 1, hasCtrlDep = 1 in {
-def BR_IF : I<(outs), (ins bb_op:$dst, I32:$a),
+def BR_IF : I<(outs), (ins I32:$a, bb_op:$dst),
[(brcond I32:$a, bb:$dst)],
- "br_if\t$dst, $a">;
+ "br_if\t$a, $dst">;
let isBarrier = 1 in {
def BR : I<(outs), (ins bb_op:$dst),
[(br bb:$dst)],
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
index fe27b1ac669..ed30b535480 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
@@ -54,8 +54,8 @@ bool WebAssemblyInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
case WebAssembly::BR_IF:
if (HaveCond)
return true;
- Cond.push_back(MI.getOperand(1));
- TBB = MI.getOperand(0).getMBB();
+ Cond.push_back(MI.getOperand(0));
+ TBB = MI.getOperand(1).getMBB();
HaveCond = true;
break;
case WebAssembly::BR:
@@ -105,8 +105,8 @@ unsigned WebAssemblyInstrInfo::InsertBranch(
}
BuildMI(&MBB, DL, get(WebAssembly::BR_IF))
- .addMBB(TBB)
- .addOperand(Cond[0]);
+ .addOperand(Cond[0])
+ .addMBB(TBB);
if (!FBB)
return 1;
OpenPOWER on IntegriCloud