diff options
author | Derek Schuff <dschuff@google.com> | 2015-11-16 21:04:51 +0000 |
---|---|---|
committer | Derek Schuff <dschuff@google.com> | 2015-11-16 21:04:51 +0000 |
commit | 4ed47784197e3922e0aa41cc89c6fd7d82221566 (patch) | |
tree | 51279d3050b2f376b7eb8692ecad7610d5c604cf /llvm/lib | |
parent | 2dd41c5d42d1f34aae67b0d883afc7b1200a4070 (diff) | |
download | bcm5719-llvm-4ed47784197e3922e0aa41cc89c6fd7d82221566.tar.gz bcm5719-llvm-4ed47784197e3922e0aa41cc89c6fd7d82221566.zip |
[WebAssembly] Reverse the order of operands for br_if
Summary: This is to match the new version in the spec
Reviewers: sunfish
Subscribers: jfb, llvm-commits, dschuff
Differential Revision: http://reviews.llvm.org/D14519
llvm-svn: 253249
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td | 4 | ||||
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp | 8 |
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; |