aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
diff options
context:
space:
mode:
authorDerek Schuff <dschuff@google.com>2015-11-16 21:04:51 +0000
committerDerek Schuff <dschuff@google.com>2015-11-16 21:04:51 +0000
commit4ed47784197e3922e0aa41cc89c6fd7d82221566 (patch)
tree51279d3050b2f376b7eb8692ecad7610d5c604cf /llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
parent2dd41c5d42d1f34aae67b0d883afc7b1200a4070 (diff)
downloadllvm-4ed47784197e3922e0aa41cc89c6fd7d82221566.zip
llvm-4ed47784197e3922e0aa41cc89c6fd7d82221566.tar.gz
llvm-4ed47784197e3922e0aa41cc89c6fd7d82221566.tar.bz2
[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/Target/WebAssembly/WebAssemblyInstrInfo.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyInstrInfo.cpp
index fe27b1a..ed30b53 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;