From 48abaa9c7409e58d1c4dd7b67cb3ac6e788bd314 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 25 Oct 2016 00:17:11 +0000 Subject: [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 --- llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyFastISel.cpp') 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); } -- cgit v1.2.3