summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <dan433584@gmail.com>2016-10-25 00:17:11 +0000
committerDan Gohman <dan433584@gmail.com>2016-10-25 00:17:11 +0000
commit48abaa9c7409e58d1c4dd7b67cb3ac6e788bd314 (patch)
treed9740adeafc3a7c86fa7d932849f90c130152f2e /llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
parent5c61c703877df673b89cb98a74edeb956b94506c (diff)
downloadbcm5719-llvm-48abaa9c7409e58d1c4dd7b67cb3ac6e788bd314.tar.gz
bcm5719-llvm-48abaa9c7409e58d1c4dd7b67cb3ac6e788bd314.zip
[WebAssembly] Reorder load/store operands to match binary encoding.
The p2align operand of a load/store is encoded before the offset operand; reorder the MachineInstr operands accordingly. llvm-svn: 285044
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp')
-rw-r--r--llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
index 5a1839459aa..628b5a501f7 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp
@@ -348,6 +348,10 @@ void WebAssemblyFastISel::materializeLoadStoreOperands(Address &Addr) {
void WebAssemblyFastISel::addLoadStoreOperands(const Address &Addr,
const MachineInstrBuilder &MIB,
MachineMemOperand *MMO) {
+ // Set the alignment operand (this is rewritten in SetP2AlignOperands).
+ // TODO: Disable SetP2AlignOperands for FastISel and just do it here.
+ MIB.addImm(0);
+
if (const GlobalValue *GV = Addr.getGlobalValue())
MIB.addGlobalAddress(GV, Addr.getOffset());
else
@@ -358,10 +362,6 @@ void WebAssemblyFastISel::addLoadStoreOperands(const Address &Addr,
else
MIB.addFrameIndex(Addr.getFI());
- // Set the alignment operand (this is rewritten in SetP2AlignOperands).
- // TODO: Disable SetP2AlignOperands for FastISel and just do it here.
- MIB.addImm(0);
-
MIB.addMemOperand(MMO);
}
OpenPOWER on IntegriCloud