[llvm] 06c3394 - Revert "[WebAssembly][GlobalISel] Implement pointer and memory ops." (#219039)

via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 26 14:47:18 PDT 2026


Author: Demetrius Kanios
Date: 2026-08-26T21:47:13Z
New Revision: 06c3394d4bd57d2222e85a3614c1c2db7fa38ff6

URL: https://github.com/llvm/llvm-project/commit/06c3394d4bd57d2222e85a3614c1c2db7fa38ff6
DIFF: https://github.com/llvm/llvm-project/commit/06c3394d4bd57d2222e85a3614c1c2db7fa38ff6.diff

LOG: Revert "[WebAssembly][GlobalISel] Implement pointer and memory ops." (#219039)

Reverts llvm/llvm-project#206885

Following failures in builder bots. See
https://github.com/llvm/llvm-project/pull/206885#issuecomment-5430450236

Added: 
    

Modified: 
    llvm/lib/Target/WebAssembly/GISel/WebAssemblyInstructionSelector.cpp
    llvm/lib/Target/WebAssembly/GISel/WebAssemblyLegalizerInfo.cpp
    llvm/lib/Target/WebAssembly/GISel/WebAssemblyRegisterBankInfo.cpp
    llvm/lib/Target/WebAssembly/WebAssemblyGISel.td
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/constant.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/implicit_def.mir

Removed: 
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/frame_index.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/global_value.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/inttoptr.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/load.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptradd.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm32.mir
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm64.mir
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrtoint.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/sextload.mir
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/store.ll
    llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/zextload.mir


################################################################################
diff  --git a/llvm/lib/Target/WebAssembly/GISel/WebAssemblyInstructionSelector.cpp b/llvm/lib/Target/WebAssembly/GISel/WebAssemblyInstructionSelector.cpp
index b5d0d68514e8e..2331b8b636603 100644
--- a/llvm/lib/Target/WebAssembly/GISel/WebAssemblyInstructionSelector.cpp
+++ b/llvm/lib/Target/WebAssembly/GISel/WebAssemblyInstructionSelector.cpp
@@ -13,8 +13,6 @@
 
 #include "GISel/WebAssemblyRegisterBankInfo.h"
 #include "MCTargetDesc/WebAssemblyMCTargetDesc.h"
-#include "Utils/WasmAddressSpaces.h"
-#include "Utils/WebAssemblyTypeUtilities.h"
 #include "WebAssemblyRegisterInfo.h"
 #include "WebAssemblySubtarget.h"
 #include "WebAssemblyTargetMachine.h"
@@ -44,23 +42,14 @@ class WebAssemblyInstructionSelector : public InstructionSelector {
 
   bool select(MachineInstr &I) override;
 
-  InstructionSelector::ComplexRendererFns
-  selectAddrOperands32(MachineOperand &Root) const;
-  InstructionSelector::ComplexRendererFns
-  selectAddrOperands64(MachineOperand &Root) const;
-
   static const char *getName() { return DEBUG_TYPE; }
 
 private:
   bool selectImpl(MachineInstr &I, CodeGenCoverage &CoverageInfo) const;
   bool selectCopy(MachineInstr &I, MachineRegisterInfo &MRI) const;
 
-  InstructionSelector::ComplexRendererFns
-  selectAddrOperands(LLT AddrType, unsigned int ConstOpc,
-                     MachineOperand &Root) const;
-
   const WebAssemblyTargetMachine &TM;
-  const WebAssemblySubtarget &STI;
+  // const WebAssemblySubtarget &STI;
   const WebAssemblyInstrInfo &TII;
   const WebAssemblyRegisterInfo &TRI;
   const WebAssemblyRegisterBankInfo &RBI;
@@ -83,8 +72,8 @@ class WebAssemblyInstructionSelector : public InstructionSelector {
 WebAssemblyInstructionSelector::WebAssemblyInstructionSelector(
     const WebAssemblyTargetMachine &TM, const WebAssemblySubtarget &STI,
     const WebAssemblyRegisterBankInfo &RBI)
-    : TM(TM), STI(STI), TII(*STI.getInstrInfo()), TRI(*STI.getRegisterInfo()),
-      RBI(RBI),
+    : TM(TM), /*STI(STI),*/ TII(*STI.getInstrInfo()),
+      TRI(*STI.getRegisterInfo()), RBI(RBI),
 
 #define GET_GLOBALISEL_PREDICATES_INIT
 #include "WebAssemblyGenGlobalISel.inc"
@@ -95,28 +84,6 @@ WebAssemblyInstructionSelector::WebAssemblyInstructionSelector(
 {
 }
 
-InstructionSelector::ComplexRendererFns
-WebAssemblyInstructionSelector::selectAddrOperands(LLT AddrType,
-                                                   unsigned int ConstOpc,
-                                                   MachineOperand &Root) const {
-  return {{
-      [=](MachineInstrBuilder &MIB) { MIB.addImm(0); },
-      [=](MachineInstrBuilder &MIB) { MIB.addReg(Root.getReg()); },
-  }};
-}
-
-InstructionSelector::ComplexRendererFns
-WebAssemblyInstructionSelector::selectAddrOperands32(
-    MachineOperand &Root) const {
-  return selectAddrOperands(LLT::integer(32), WebAssembly::CONST_I32, Root);
-}
-
-InstructionSelector::ComplexRendererFns
-WebAssemblyInstructionSelector::selectAddrOperands64(
-    MachineOperand &Root) const {
-  return selectAddrOperands(LLT::integer(64), WebAssembly::CONST_I64, Root);
-}
-
 bool WebAssemblyInstructionSelector::selectCopy(
     MachineInstr &I, MachineRegisterInfo &MRI) const {
   const TargetRegisterClass *DstRC =
@@ -173,7 +140,6 @@ bool WebAssemblyInstructionSelector::select(MachineInstr &I) {
   MachineBasicBlock &MBB = *I.getParent();
   MachineFunction &MF = *MBB.getParent();
   MachineRegisterInfo &MRI = MF.getRegInfo();
-  const TargetLowering &TLI = *STI.getTargetLowering();
 
   if (!I.isPreISelOpcode()) {
     if (I.isCopy())
@@ -199,92 +165,6 @@ bool WebAssemblyInstructionSelector::select(MachineInstr &I) {
     I.setDesc(TII.get(TargetOpcode::IMPLICIT_DEF));
     return RBI.constrainGenericRegister(DefReg, *DefRC, MRI) != nullptr;
   }
-  case G_PTRTOINT: {
-    bool PtrIsI64 = MRI.getType(I.getOperand(1).getReg()).getSizeInBits() == 64;
-
-    I.setDesc(
-        TII.get(PtrIsI64 ? WebAssembly::COPY_I64 : WebAssembly::COPY_I32));
-    constrainSelectedInstRegOperands(I, TII, TRI, RBI);
-    return true;
-  }
-  case G_INTTOPTR: {
-    bool PtrIsI64 = MRI.getType(I.getOperand(0).getReg()).getSizeInBits() == 64;
-
-    I.setDesc(
-        TII.get(PtrIsI64 ? WebAssembly::COPY_I64 : WebAssembly::COPY_I32));
-    constrainSelectedInstRegOperands(I, TII, TRI, RBI);
-    return true;
-  }
-  case G_PTRMASK: {
-    bool PtrIsI64 = MRI.getType(I.getOperand(0).getReg()).getSizeInBits() == 64;
-
-    I.setDesc(TII.get(PtrIsI64 ? WebAssembly::AND_I64 : WebAssembly::AND_I32));
-    constrainSelectedInstRegOperands(I, TII, TRI, RBI);
-    return true;
-  }
-  case G_GLOBAL_VALUE: {
-    assert(I.getOperand(1).getTargetFlags() == 0 &&
-           "Unexpected target flags on generic G_GLOBAL_VALUE instruction");
-
-    unsigned OperandFlags = 0;
-    const llvm::GlobalValue *GV = I.getOperand(1).getGlobal();
-    LLT PtrTy = MRI.getType(I.getOperand(0).getReg());
-    bool PtrIsI64 = PtrTy.getSizeInBits() == 64;
-
-    if (TLI.isPositionIndependent()) {
-      if (TM.shouldAssumeDSOLocal(GV)) {
-        const char *BaseName;
-        if (GV->getValueType()->isFunctionTy()) {
-          BaseName = MF.createExternalSymbolName("__table_base");
-          OperandFlags = WebAssemblyII::MO_TABLE_BASE_REL;
-        } else {
-          BaseName = MF.createExternalSymbolName("__memory_base");
-          OperandFlags = WebAssemblyII::MO_MEMORY_BASE_REL;
-        }
-        MachineIRBuilder B(I);
-
-        Register MemBase = MRI.createVirtualRegister(
-            PtrIsI64 ? &WebAssembly::I64RegClass : &WebAssembly::I32RegClass);
-
-        Register Offset = MRI.createVirtualRegister(
-            PtrIsI64 ? &WebAssembly::I64RegClass : &WebAssembly::I32RegClass);
-
-        B.buildInstr(PtrIsI64 ? WebAssembly::GLOBAL_GET_I64
-                              : WebAssembly::GLOBAL_GET_I32)
-            .addDef(MemBase)
-            .addExternalSymbol(BaseName);
-
-        B.buildInstr(PtrIsI64 ? WebAssembly::CONST_I64 : WebAssembly::CONST_I32)
-            .addDef(Offset)
-            .addGlobalAddress(GV, I.getOperand(1).getOffset(), OperandFlags);
-
-        auto MIB =
-            B.buildInstr(PtrIsI64 ? WebAssembly::ADD_I64 : WebAssembly::ADD_I32)
-                .addDef(I.getOperand(0).getReg())
-                .addReg(MemBase)
-                .addReg(Offset);
-        constrainSelectedInstRegOperands(*MIB, TII, TRI, RBI);
-
-        I.eraseFromParent();
-        return true;
-      }
-      OperandFlags = WebAssemblyII::MO_GOT;
-    }
-
-    unsigned NewOpc =
-        PtrIsI64 ? WebAssembly::CONST_I64 : WebAssembly::CONST_I32;
-
-    if (OperandFlags & WebAssemblyII::MO_GOT) {
-      NewOpc =
-          PtrIsI64 ? WebAssembly::GLOBAL_GET_I64 : WebAssembly::GLOBAL_GET_I32;
-    }
-
-    I.setDesc(TII.get(NewOpc));
-    I.getOperand(1).setTargetFlags(OperandFlags);
-    constrainSelectedInstRegOperands(I, TII, TRI, RBI);
-
-    return true;
-  }
   default:
     break;
   }

diff  --git a/llvm/lib/Target/WebAssembly/GISel/WebAssemblyLegalizerInfo.cpp b/llvm/lib/Target/WebAssembly/GISel/WebAssemblyLegalizerInfo.cpp
index 41a1813283f5b..1fe8298b8e555 100644
--- a/llvm/lib/Target/WebAssembly/GISel/WebAssemblyLegalizerInfo.cpp
+++ b/llvm/lib/Target/WebAssembly/GISel/WebAssemblyLegalizerInfo.cpp
@@ -26,8 +26,6 @@ WebAssemblyLegalizerInfo::WebAssemblyLegalizerInfo(
     const WebAssemblySubtarget &ST) {
   using namespace TargetOpcode;
 
-  const LLT i8 = LLT::integer(8);
-  const LLT i16 = LLT::integer(16);
   const LLT i32 = LLT::integer(32);
   const LLT i64 = LLT::integer(64);
 
@@ -37,22 +35,13 @@ WebAssemblyLegalizerInfo::WebAssemblyLegalizerInfo(
   const LLT s32 = LLT::scalar(32);
   const LLT s64 = LLT::scalar(64);
 
-  const LLT p0 = LLT::pointer(0, ST.hasAddr64() ? 64 : 32);
-  const LLT p0i = LLT::integer(ST.hasAddr64() ? 64 : 32);
-  const LLT p0s = LLT::scalar(ST.hasAddr64() ? 64 : 32);
-
   getActionDefinitionsBuilder(G_IMPLICIT_DEF)
-      .legalFor({i32, i64, f32, f64, p0})
+      .legalFor({i32, i64, f32, f64})
       .widenScalarToNextPow2(0)
       .clampScalar(0, s32, s64);
 
-  getActionDefinitionsBuilder(G_CONSTANT)
-      .legalFor({i32, i64, p0})
-      .widenScalarToNextPow2(0)
-      .clampScalar(0, s32, s64);
-
-  getActionDefinitionsBuilder(
-      {G_ADD, G_SUB, G_MUL, G_UDIV, G_SDIV, G_UREM, G_SREM, G_AND, G_OR, G_XOR})
+  getActionDefinitionsBuilder({G_CONSTANT, G_ADD, G_SUB, G_MUL, G_UDIV, G_SDIV,
+                               G_UREM, G_SREM, G_AND, G_OR, G_XOR})
       .legalFor({i32, i64})
       .widenScalarToNextPow2(0)
       .clampScalar(0, s32, s64);
@@ -165,63 +154,6 @@ WebAssemblyLegalizerInfo::WebAssemblyLegalizerInfo(
       .widenScalarToNextPow2(0)
       .clampScalar(0, s32, s64)
       .clampScalar(1, s32, s32);
-
-  getActionDefinitionsBuilder(G_PTRTOINT)
-      .legalFor({{p0i, p0}})
-      .clampScalar(0, p0s, p0s);
-  getActionDefinitionsBuilder(G_INTTOPTR)
-      .legalFor({{p0, p0i}})
-      .clampScalar(1, p0s, p0s);
-
-  getActionDefinitionsBuilder({G_PTR_ADD, G_PTRMASK})
-      .legalFor({{p0, p0i}})
-      .clampScalar(1, p0s, p0s);
-
-  getActionDefinitionsBuilder({G_FRAME_INDEX, G_GLOBAL_VALUE}).legalFor({p0});
-
-  getActionDefinitionsBuilder(G_LOAD)
-      .legalForTypesWithMemDesc({{i32, p0, i8, 1},
-                                 {i32, p0, i16, 1},
-                                 {i32, p0, i32, 1},
-
-                                 {i64, p0, i8, 1},
-                                 {i64, p0, i16, 1},
-                                 {i64, p0, i32, 1},
-                                 {i64, p0, i64, 1},
-
-                                 {f32, p0, f32, 1},
-                                 {f64, p0, f64, 1},
-
-                                 {p0, p0, p0, 1}})
-      .clampScalar(0, s32, s64)
-      .lowerIfMemSizeNotByteSizePow2();
-
-  getActionDefinitionsBuilder({G_ZEXTLOAD, G_SEXTLOAD})
-      .legalForTypesWithMemDesc({{i32, p0, i8, 1},
-                                 {i32, p0, i16, 1},
-
-                                 {i64, p0, i8, 1},
-                                 {i64, p0, i16, 1},
-                                 {i64, p0, i32, 1}})
-      .clampScalar(0, s32, s64)
-      .lowerIfMemSizeNotByteSizePow2();
-
-  getActionDefinitionsBuilder(G_STORE)
-      .legalForTypesWithMemDesc({{i32, p0, i8, 1},
-                                 {i32, p0, i16, 1},
-                                 {i32, p0, i32, 1},
-
-                                 {i64, p0, i8, 1},
-                                 {i64, p0, i16, 1},
-                                 {i64, p0, s32, 1},
-                                 {i64, p0, i64, 1},
-
-                                 {f32, p0, f32, 1},
-                                 {f64, p0, f64, 1},
-
-                                 {p0, p0, p0, 1}})
-      .clampScalar(0, s32, s64)
-      .lowerIfMemSizeNotByteSizePow2();
 }
 
 bool WebAssemblyLegalizerInfo::legalizeCustom(

diff  --git a/llvm/lib/Target/WebAssembly/GISel/WebAssemblyRegisterBankInfo.cpp b/llvm/lib/Target/WebAssembly/GISel/WebAssemblyRegisterBankInfo.cpp
index 78f2f3d3fae03..7e50ca6ab22fe 100644
--- a/llvm/lib/Target/WebAssembly/GISel/WebAssemblyRegisterBankInfo.cpp
+++ b/llvm/lib/Target/WebAssembly/GISel/WebAssemblyRegisterBankInfo.cpp
@@ -77,7 +77,7 @@ WebAssemblyRegisterBankInfo::getInstrMapping(const MachineInstr &MI) const {
 
     OpSize[Idx] = Ty.getSizeInBits().getKnownMinValue();
 
-    if (Ty.isInteger() || (Ty.isPointer() && Ty.getAddressSpace() == 0)) {
+    if (Ty.isInteger()) {
       if (OpSize[Idx] == 32) {
         OpRegBankIdx[Idx] = WebAssembly::PMI_I32;
       } else if (OpSize[Idx] == 64) {

diff  --git a/llvm/lib/Target/WebAssembly/WebAssemblyGISel.td b/llvm/lib/Target/WebAssembly/WebAssemblyGISel.td
index 640bd279cb20b..0e49d61deca67 100644
--- a/llvm/lib/Target/WebAssembly/WebAssemblyGISel.td
+++ b/llvm/lib/Target/WebAssembly/WebAssemblyGISel.td
@@ -15,32 +15,3 @@
 
 include "WebAssembly.td"
 include "WebAssemblyCombine.td"
-
-defvar ModeAddr32 = DefaultMode;
-def ModeAddr64 : HwMode<[HasAddr64]>;
-
-def p0i : ValueTypeByHwMode<[ModeAddr32, ModeAddr64],
-                            [i32, i64]>;
-def p0 : PtrValueTypeByHwMode<p0i, 0>;
-
-
-def : Pat<(p0 (ptradd p0:$lhs, p0i:$rhs)),
-          (ADD_I32 I32:$lhs, I32:$rhs)>, Requires<[HasAddr32]>;
-def : Pat<(p0 (ptradd p0:$lhs, p0i:$rhs)),
-          (ADD_I64 I64:$lhs, I64:$rhs)>, Requires<[HasAddr64]>;
-
-def : Pat<(frameindex:$fi),
-          (COPY_I32 (to_tframeindex $fi))>, Requires<[HasAddr32]>;
-def : Pat<(frameindex:$fi),
-          (COPY_I64 (to_tframeindex $fi))>, Requires<[HasAddr64]>;
-
-
-//===----------------------------------------------------------------------===//
-// Complex pattern equivalents
-//===----------------------------------------------------------------------===//
-
-def gi_AddrOps32 : GIComplexOperandMatcher<s32, "selectAddrOperands32">,
-                   GIComplexPatternEquiv<AddrOps32>;
-
-def gi_AddrOps64 : GIComplexOperandMatcher<s64, "selectAddrOperands64">,
-                   GIComplexPatternEquiv<AddrOps64>;

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/constant.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/constant.ll
index 7e74d6035afa4..8ceda5bb3740a 100644
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/constant.ll
+++ b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/constant.ll
@@ -1,7 +1,7 @@
 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefixes=CHECK,WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefixes=CHECK,WASM64
+; RUN: llc < %s -O0 --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s
 
+target triple = "wasm32-unknown-unknown"
 
 define i1 @const_i1() {
 ; CHECK-LABEL: const_i1:
@@ -83,19 +83,3 @@ define i64 @const_i64() {
 ; CHECK-NEXT:    return $pop0
   ret i64 18446744073709551615
 }
-
-
-define ptr @const_p0() {
-; WASM32-LABEL: const_p0:
-; WASM32:         .functype const_p0 () -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    i32.const $push0=, 0
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: const_p0:
-; WASM64:         .functype const_p0 () -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    i64.const $push0=, 0
-; WASM64-NEXT:    return $pop0
-  ret ptr null
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/frame_index.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/frame_index.ll
deleted file mode 100644
index 998adf5ce5885..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/frame_index.ll
+++ /dev/null
@@ -1,35 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64
-
-define ptr @frame_index() {
-; WASM32-LABEL: frame_index:
-; WASM32:         .functype frame_index () -> (i32)
-; WASM32-NEXT:    .local i32
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    global.get $push1=, __stack_pointer
-; WASM32-NEXT:    i32.const $push2=, 16
-; WASM32-NEXT:    i32.sub $push4=, $pop1, $pop2
-; WASM32-NEXT:    local.set 0, $pop4
-; WASM32-NEXT:    local.get $push5=, 0
-; WASM32-NEXT:    i32.const $push3=, 14
-; WASM32-NEXT:    i32.add $push0=, $pop5, $pop3
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: frame_index:
-; WASM64:         .functype frame_index () -> (i64)
-; WASM64-NEXT:    .local i64
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    global.get $push1=, __stack_pointer
-; WASM64-NEXT:    i64.const $push2=, 16
-; WASM64-NEXT:    i64.sub $push4=, $pop1, $pop2
-; WASM64-NEXT:    local.set 0, $pop4
-; WASM64-NEXT:    local.get $push5=, 0
-; WASM64-NEXT:    i64.const $push3=, 14
-; WASM64-NEXT:    i64.add $push0=, $pop5, $pop3
-; WASM64-NEXT:    return $pop0
-  %a = alloca i16
-  %b = alloca double
-
-  ret ptr %a
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/global_value.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/global_value.ll
deleted file mode 100644
index 481f4e84a5967..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/global_value.ll
+++ /dev/null
@@ -1,127 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -relocation-model=pic -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32-PIC
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -relocation-model=pic -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64-PIC
-
- at globl = global i32 0
-declare void @func()
-
- at globl_local = dso_local global i32 0
-declare dso_local void @func_local()
-
-define ptr @global_value_globl() {
-; WASM32-LABEL: global_value_globl:
-; WASM32:         .functype global_value_globl () -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    i32.const $push0=, globl
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: global_value_globl:
-; WASM64:         .functype global_value_globl () -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    i64.const $push0=, globl
-; WASM64-NEXT:    return $pop0
-;
-; WASM32-PIC-LABEL: global_value_globl:
-; WASM32-PIC:         .functype global_value_globl () -> (i32)
-; WASM32-PIC-NEXT:  # %bb.0:
-; WASM32-PIC-NEXT:    global.get $push0=, globl at GOT
-; WASM32-PIC-NEXT:    return $pop0
-;
-; WASM64-PIC-LABEL: global_value_globl:
-; WASM64-PIC:         .functype global_value_globl () -> (i64)
-; WASM64-PIC-NEXT:  # %bb.0:
-; WASM64-PIC-NEXT:    global.get $push0=, globl at GOT
-; WASM64-PIC-NEXT:    return $pop0
-  ret ptr @globl
-}
-
-define ptr @global_value_func() {
-; WASM32-LABEL: global_value_func:
-; WASM32:         .functype global_value_func () -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    i32.const $push0=, func
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: global_value_func:
-; WASM64:         .functype global_value_func () -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    i64.const $push0=, func
-; WASM64-NEXT:    return $pop0
-;
-; WASM32-PIC-LABEL: global_value_func:
-; WASM32-PIC:         .functype global_value_func () -> (i32)
-; WASM32-PIC-NEXT:  # %bb.0:
-; WASM32-PIC-NEXT:    global.get $push0=, func at GOT
-; WASM32-PIC-NEXT:    return $pop0
-;
-; WASM64-PIC-LABEL: global_value_func:
-; WASM64-PIC:         .functype global_value_func () -> (i64)
-; WASM64-PIC-NEXT:  # %bb.0:
-; WASM64-PIC-NEXT:    global.get $push0=, func at GOT
-; WASM64-PIC-NEXT:    return $pop0
-  ret ptr @func
-}
-
-define ptr @global_value_globl_local() {
-; WASM32-LABEL: global_value_globl_local:
-; WASM32:         .functype global_value_globl_local () -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    i32.const $push0=, globl_local
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: global_value_globl_local:
-; WASM64:         .functype global_value_globl_local () -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    i64.const $push0=, globl_local
-; WASM64-NEXT:    return $pop0
-;
-; WASM32-PIC-LABEL: global_value_globl_local:
-; WASM32-PIC:         .functype global_value_globl_local () -> (i32)
-; WASM32-PIC-NEXT:  # %bb.0:
-; WASM32-PIC-NEXT:    global.get $push1=, __memory_base
-; WASM32-PIC-NEXT:    i32.const $push2=, globl_local at MBREL
-; WASM32-PIC-NEXT:    i32.add $push0=, $pop1, $pop2
-; WASM32-PIC-NEXT:    return $pop0
-;
-; WASM64-PIC-LABEL: global_value_globl_local:
-; WASM64-PIC:         .functype global_value_globl_local () -> (i64)
-; WASM64-PIC-NEXT:  # %bb.0:
-; WASM64-PIC-NEXT:    global.get $push1=, __memory_base
-; WASM64-PIC-NEXT:    i64.const $push2=, globl_local at MBREL
-; WASM64-PIC-NEXT:    i64.add $push0=, $pop1, $pop2
-; WASM64-PIC-NEXT:    return $pop0
-  ret ptr @globl_local
-}
-
-define ptr @global_value_func_local() {
-; WASM32-LABEL: global_value_func_local:
-; WASM32:         .functype global_value_func_local () -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    i32.const $push0=, func_local
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: global_value_func_local:
-; WASM64:         .functype global_value_func_local () -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    i64.const $push0=, func_local
-; WASM64-NEXT:    return $pop0
-;
-; WASM32-PIC-LABEL: global_value_func_local:
-; WASM32-PIC:         .functype global_value_func_local () -> (i32)
-; WASM32-PIC-NEXT:  # %bb.0:
-; WASM32-PIC-NEXT:    global.get $push1=, __table_base
-; WASM32-PIC-NEXT:    i32.const $push2=, func_local at TBREL
-; WASM32-PIC-NEXT:    i32.add $push0=, $pop1, $pop2
-; WASM32-PIC-NEXT:    return $pop0
-;
-; WASM64-PIC-LABEL: global_value_func_local:
-; WASM64-PIC:         .functype global_value_func_local () -> (i64)
-; WASM64-PIC-NEXT:  # %bb.0:
-; WASM64-PIC-NEXT:    global.get $push1=, __table_base
-; WASM64-PIC-NEXT:    i64.const $push2=, func_local at TBREL
-; WASM64-PIC-NEXT:    i64.add $push0=, $pop1, $pop2
-; WASM64-PIC-NEXT:    return $pop0
-  ret ptr @func_local
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/implicit_def.mir b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/implicit_def.mir
index 6cebd3492cef9..7c9b8f91b1ecf 100644
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/implicit_def.mir
+++ b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/implicit_def.mir
@@ -1,6 +1,5 @@
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
-# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=CHECK,WASM32
-# RUN: llc -mtriple=wasm64-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=CHECK,WASM64
+# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s
 
 ---
 name:            implicit_def_i8
@@ -99,25 +98,3 @@ body:             |
     %0:_(f64) = G_IMPLICIT_DEF
     RETURN %0(f64), implicit-def $arguments
 ...
-
----
-name:            implicit_def_p0
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: implicit_def_p0
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: RETURN [[DEF]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: implicit_def_p0
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: RETURN [[DEF]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    RETURN %0(p0), implicit-def $arguments
-...

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/inttoptr.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/inttoptr.ll
deleted file mode 100644
index 8aaa8b400c7b5..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/inttoptr.ll
+++ /dev/null
@@ -1,79 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64
-
-define ptr @inttoptr_i8(i8 %x) {
-; WASM32-LABEL: inttoptr_i8:
-; WASM32:         .functype inttoptr_i8 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push2=, 0
-; WASM32-NEXT:    i32.const $push1=, 255
-; WASM32-NEXT:    i32.and $push0=, $pop2, $pop1
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: inttoptr_i8:
-; WASM64:         .functype inttoptr_i8 (i32) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push3=, 0
-; WASM64-NEXT:    i64.extend_i32_u $push1=, $pop3
-; WASM64-NEXT:    i64.const $push2=, 255
-; WASM64-NEXT:    i64.and $push0=, $pop1, $pop2
-; WASM64-NEXT:    return $pop0
-  %a = inttoptr i8 %x to ptr
-  ret ptr %a
-}
-
-define ptr @inttoptr_i16(i16 %x) {
-; WASM32-LABEL: inttoptr_i16:
-; WASM32:         .functype inttoptr_i16 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push2=, 0
-; WASM32-NEXT:    i32.const $push1=, 65535
-; WASM32-NEXT:    i32.and $push0=, $pop2, $pop1
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: inttoptr_i16:
-; WASM64:         .functype inttoptr_i16 (i32) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push3=, 0
-; WASM64-NEXT:    i64.extend_i32_u $push1=, $pop3
-; WASM64-NEXT:    i64.const $push2=, 65535
-; WASM64-NEXT:    i64.and $push0=, $pop1, $pop2
-; WASM64-NEXT:    return $pop0
-  %a = inttoptr i16 %x to ptr
-  ret ptr %a
-}
-
-define ptr @inttoptr_i32(i32 %x) {
-; WASM32-LABEL: inttoptr_i32:
-; WASM32:         .functype inttoptr_i32 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push0=, 0
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: inttoptr_i32:
-; WASM64:         .functype inttoptr_i32 (i32) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i64.extend_i32_u $push0=, $pop1
-; WASM64-NEXT:    return $pop0
-  %a = inttoptr i32 %x to ptr
-  ret ptr %a
-}
-
-define ptr @inttoptr_i64(i64 %x) {
-; WASM32-LABEL: inttoptr_i64:
-; WASM32:         .functype inttoptr_i64 (i64) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i32.wrap_i64 $push0=, $pop1
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: inttoptr_i64:
-; WASM64:         .functype inttoptr_i64 (i64) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push0=, 0
-; WASM64-NEXT:    return $pop0
-  %a = inttoptr i64 %x to ptr
-  ret ptr %a
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/load.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/load.ll
deleted file mode 100644
index cfed662c7a333..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/load.ll
+++ /dev/null
@@ -1,198 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64
-
-define i1 @load_i1(ptr %x) {
-; WASM32-LABEL: load_i1:
-; WASM32:         .functype load_i1 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i32.load8_u $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_i1:
-; WASM64:         .functype load_i1 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.load8_u $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load i1, ptr %x
-  ret i1 %a
-}
-
-define i8 @load_i8(ptr %x) {
-; WASM32-LABEL: load_i8:
-; WASM32:         .functype load_i8 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i32.load8_u $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_i8:
-; WASM64:         .functype load_i8 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.load8_u $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load i8, ptr %x
-  ret i8 %a
-}
-
-define i16 @load_i16(ptr %x) {
-; WASM32-LABEL: load_i16:
-; WASM32:         .functype load_i16 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i32.load16_u $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_i16:
-; WASM64:         .functype load_i16 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.load16_u $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load i16, ptr %x
-  ret i16 %a
-}
-
-define i32 @load_i32(ptr %x) {
-; WASM32-LABEL: load_i32:
-; WASM32:         .functype load_i32 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i32.load $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_i32:
-; WASM64:         .functype load_i32 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.load $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load i32, ptr %x
-  ret i32 %a
-}
-
-define i32 @load_i32_align1(ptr %x) {
-; WASM32-LABEL: load_i32_align1:
-; WASM32:         .functype load_i32_align1 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i32.load $push0=, 0($pop1):p2align=0
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_i32_align1:
-; WASM64:         .functype load_i32_align1 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.load $push0=, 0($pop1):p2align=0
-; WASM64-NEXT:    return $pop0
-  %a = load i32, ptr %x, align 1
-  ret i32 %a
-}
-
-define i48 @load_i48(ptr %x) {
-; WASM32-LABEL: load_i48:
-; WASM32:         .functype load_i48 (i32) -> (i64)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push7=, 0
-; WASM32-NEXT:    i64.load32_u $push0=, 0($pop7)
-; WASM32-NEXT:    local.get $push8=, 0
-; WASM32-NEXT:    i32.const $push1=, 4
-; WASM32-NEXT:    i32.add $push2=, $pop8, $pop1
-; WASM32-NEXT:    i64.load16_u $push3=, 0($pop2)
-; WASM32-NEXT:    i64.const $push4=, 32
-; WASM32-NEXT:    i64.shl $push5=, $pop3, $pop4
-; WASM32-NEXT:    i64.or $push6=, $pop0, $pop5
-; WASM32-NEXT:    return $pop6
-;
-; WASM64-LABEL: load_i48:
-; WASM64:         .functype load_i48 (i64) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push7=, 0
-; WASM64-NEXT:    i64.load32_u $push0=, 0($pop7)
-; WASM64-NEXT:    local.get $push8=, 0
-; WASM64-NEXT:    i64.const $push1=, 4
-; WASM64-NEXT:    i64.add $push2=, $pop8, $pop1
-; WASM64-NEXT:    i64.load16_u $push3=, 0($pop2)
-; WASM64-NEXT:    i64.const $push4=, 32
-; WASM64-NEXT:    i64.shl $push5=, $pop3, $pop4
-; WASM64-NEXT:    i64.or $push6=, $pop0, $pop5
-; WASM64-NEXT:    return $pop6
-  %a = load i48, ptr %x
-  ret i48 %a
-}
-
-define i64 @load_i64(ptr %x) {
-; WASM32-LABEL: load_i64:
-; WASM32:         .functype load_i64 (i32) -> (i64)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i64.load $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_i64:
-; WASM64:         .functype load_i64 (i64) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i64.load $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load i64, ptr %x
-  ret i64 %a
-}
-
-
-define float @load_f32(ptr %x) {
-; WASM32-LABEL: load_f32:
-; WASM32:         .functype load_f32 (i32) -> (f32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    f32.load $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_f32:
-; WASM64:         .functype load_f32 (i64) -> (f32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    f32.load $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load float, ptr %x
-  ret float %a
-}
-
-define double @load_f64(ptr %x) {
-; WASM32-LABEL: load_f64:
-; WASM32:         .functype load_f64 (i32) -> (f64)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    f64.load $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_f64:
-; WASM64:         .functype load_f64 (i64) -> (f64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    f64.load $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load double, ptr %x
-  ret double %a
-}
-
-define ptr @load_ptr(ptr %x) {
-; WASM32-LABEL: load_ptr:
-; WASM32:         .functype load_ptr (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i32.load $push0=, 0($pop1)
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: load_ptr:
-; WASM64:         .functype load_ptr (i64) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i64.load $push0=, 0($pop1)
-; WASM64-NEXT:    return $pop0
-  %a = load ptr, ptr %x
-  ret ptr %a
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptradd.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptradd.ll
deleted file mode 100644
index 44083d110c8e4..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptradd.ll
+++ /dev/null
@@ -1,91 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64
-
-define ptr @ptradd_i8(ptr %x, i8 %y) {
-; WASM32-LABEL: ptradd_i8:
-; WASM32:         .functype ptradd_i8 (i32, i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push3=, 0
-; WASM32-NEXT:    local.get $push2=, 1
-; WASM32-NEXT:    i32.extend8_s $push0=, $pop2
-; WASM32-NEXT:    i32.add $push1=, $pop3, $pop0
-; WASM32-NEXT:    return $pop1
-;
-; WASM64-LABEL: ptradd_i8:
-; WASM64:         .functype ptradd_i8 (i64, i32) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push4=, 0
-; WASM64-NEXT:    local.get $push3=, 1
-; WASM64-NEXT:    i64.extend_i32_u $push2=, $pop3
-; WASM64-NEXT:    i64.extend8_s $push0=, $pop2
-; WASM64-NEXT:    i64.add $push1=, $pop4, $pop0
-; WASM64-NEXT:    return $pop1
-  %a = getelementptr i8, ptr %x, i8 %y
-  ret ptr %a
-}
-
-define ptr @ptradd_i16(ptr %x, i16 %y) {
-; WASM32-LABEL: ptradd_i16:
-; WASM32:         .functype ptradd_i16 (i32, i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push3=, 0
-; WASM32-NEXT:    local.get $push2=, 1
-; WASM32-NEXT:    i32.extend16_s $push0=, $pop2
-; WASM32-NEXT:    i32.add $push1=, $pop3, $pop0
-; WASM32-NEXT:    return $pop1
-;
-; WASM64-LABEL: ptradd_i16:
-; WASM64:         .functype ptradd_i16 (i64, i32) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push4=, 0
-; WASM64-NEXT:    local.get $push3=, 1
-; WASM64-NEXT:    i64.extend_i32_u $push2=, $pop3
-; WASM64-NEXT:    i64.extend16_s $push0=, $pop2
-; WASM64-NEXT:    i64.add $push1=, $pop4, $pop0
-; WASM64-NEXT:    return $pop1
-  %a = getelementptr i8, ptr %x, i16 %y
-  ret ptr %a
-}
-
-define ptr @ptradd_i32(ptr %x, i32 %y) {
-; WASM32-LABEL: ptradd_i32:
-; WASM32:         .functype ptradd_i32 (i32, i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push2=, 0
-; WASM32-NEXT:    local.get $push1=, 1
-; WASM32-NEXT:    i32.add $push0=, $pop2, $pop1
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: ptradd_i32:
-; WASM64:         .functype ptradd_i32 (i64, i32) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push3=, 0
-; WASM64-NEXT:    local.get $push2=, 1
-; WASM64-NEXT:    i64.extend_i32_s $push0=, $pop2
-; WASM64-NEXT:    i64.add $push1=, $pop3, $pop0
-; WASM64-NEXT:    return $pop1
-  %a = getelementptr i8, ptr %x, i32 %y
-  ret ptr %a
-}
-
-define ptr @ptradd_i64(ptr %x, i64 %y) {
-; WASM32-LABEL: ptradd_i64:
-; WASM32:         .functype ptradd_i64 (i32, i64) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push3=, 0
-; WASM32-NEXT:    local.get $push2=, 1
-; WASM32-NEXT:    i32.wrap_i64 $push0=, $pop2
-; WASM32-NEXT:    i32.add $push1=, $pop3, $pop0
-; WASM32-NEXT:    return $pop1
-;
-; WASM64-LABEL: ptradd_i64:
-; WASM64:         .functype ptradd_i64 (i64, i64) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push2=, 0
-; WASM64-NEXT:    local.get $push1=, 1
-; WASM64-NEXT:    i64.add $push0=, $pop2, $pop1
-; WASM64-NEXT:    return $pop0
-  %a = getelementptr i8, ptr %x, i64 %y
-  ret ptr %a
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask.ll
deleted file mode 100644
index ab4e4de2ad79d..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask.ll
+++ /dev/null
@@ -1,17 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: sed 's/iX/i32/g' < %s > %t && llc < %t -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %t
-; RUN: sed 's/iX/i64/g' < %s > %t && llc < %t -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %t
-
-declare ptr @llvm.ptrmask(ptr, iX)
-
-define ptr @ptrmask(ptr %x, iX %y) {
-; CHECK-LABEL: ptrmask:
-; CHECK:         .functype ptrmask (iX, iX) -> (iX)
-; CHECK-NEXT:  # %bb.0:
-; CHECK-NEXT:    local.get $push2=, 0
-; CHECK-NEXT:    local.get $push1=, 1
-; CHECK-NEXT:    iX.and $push0=, $pop2, $pop1
-; CHECK-NEXT:    return $pop0
-  %a = call ptr @llvm.ptrmask(ptr %x, iX %y)
-  ret ptr %a
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm32.mir b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm32.mir
deleted file mode 100644
index 876f03332981d..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm32.mir
+++ /dev/null
@@ -1,85 +0,0 @@
-# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
-# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=CHECK
-
----
-name:            ptrmask_i8
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i8
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i32_:%[0-9]+]]:i32 = ARGUMENT_i32 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i32_1:%[0-9]+]]:i32 = ARGUMENT_i32 1, implicit $arguments
-    ; CHECK-NEXT: [[CONST_I32_:%[0-9]+]]:i32 = CONST_I32 255, implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I32_:%[0-9]+]]:i32 = AND_I32 [[ARGUMENT_i32_1]], [[CONST_I32_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I32_1:%[0-9]+]]:i32 = AND_I32 [[ARGUMENT_i32_]], [[AND_I32_]]
-    ; CHECK-NEXT: RETURN [[AND_I32_1]], implicit-def $arguments
-    %0:i32(p0)  = ARGUMENT_i32 0, implicit $arguments
-    %2:i32(i32) = ARGUMENT_i32 1, implicit $arguments
-    %1:_(i8) = G_TRUNC %2(i32)
-    %3:_(p0) = G_PTRMASK %0, %1(i8)
-    RETURN %3(p0), implicit-def $arguments
-...
-
----
-name:            ptrmask_i16
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i16
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i32_:%[0-9]+]]:i32 = ARGUMENT_i32 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i32_1:%[0-9]+]]:i32 = ARGUMENT_i32 1, implicit $arguments
-    ; CHECK-NEXT: [[CONST_I32_:%[0-9]+]]:i32 = CONST_I32 65535, implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I32_:%[0-9]+]]:i32 = AND_I32 [[ARGUMENT_i32_1]], [[CONST_I32_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I32_1:%[0-9]+]]:i32 = AND_I32 [[ARGUMENT_i32_]], [[AND_I32_]]
-    ; CHECK-NEXT: RETURN [[AND_I32_1]], implicit-def $arguments
-    %0:i32(p0)  = ARGUMENT_i32 0, implicit $arguments
-    %2:i32(i32) = ARGUMENT_i32 1, implicit $arguments
-    %1:_(i16) = G_TRUNC %2(i32)
-    %3:_(p0) = G_PTRMASK %0, %1(i16)
-    RETURN %3(p0), implicit-def $arguments
-...
-
----
-name:            ptrmask_i32
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i32
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i32_:%[0-9]+]]:i32 = ARGUMENT_i32 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i32_1:%[0-9]+]]:i32 = ARGUMENT_i32 1, implicit $arguments
-    ; CHECK-NEXT: [[AND_I32_:%[0-9]+]]:i32 = AND_I32 [[ARGUMENT_i32_]], [[ARGUMENT_i32_1]]
-    ; CHECK-NEXT: RETURN [[AND_I32_]], implicit-def $arguments
-    %0:i32(p0)  = ARGUMENT_i32 0, implicit $arguments
-    %1:i32(i32) = ARGUMENT_i32 1, implicit $arguments
-    %2:_(p0) = G_PTRMASK %0, %1(i32)
-    RETURN %2(p0), implicit-def $arguments
-...
-
----
-name:            ptrmask_i64
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i64
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i32_:%[0-9]+]]:i32 = ARGUMENT_i32 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i64_:%[0-9]+]]:i64 = ARGUMENT_i64 1, implicit $arguments
-    ; CHECK-NEXT: [[I32_WRAP_I64_:%[0-9]+]]:i32 = I32_WRAP_I64 [[ARGUMENT_i64_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I32_:%[0-9]+]]:i32 = AND_I32 [[ARGUMENT_i32_]], [[I32_WRAP_I64_]]
-    ; CHECK-NEXT: RETURN [[AND_I32_]], implicit-def $arguments
-    %0:i32(p0)  = ARGUMENT_i32 0, implicit $arguments
-    %1:i64(i64) = ARGUMENT_i64 1, implicit $arguments
-    %2:_(p0) = G_PTRMASK %0, %1(i64)
-    RETURN %2(p0), implicit-def $arguments
-...

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm64.mir b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm64.mir
deleted file mode 100644
index 9992eb07fbf16..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrmask_wasm64.mir
+++ /dev/null
@@ -1,87 +0,0 @@
-# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
-# RUN: llc -mtriple=wasm64-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=CHECK
-
----
-name:            ptrmask_i8
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i8
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i64_:%[0-9]+]]:i64 = ARGUMENT_i64 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i32_:%[0-9]+]]:i32 = ARGUMENT_i32 1, implicit $arguments
-    ; CHECK-NEXT: [[I64_EXTEND_U_I32_:%[0-9]+]]:i64 = I64_EXTEND_U_I32 [[ARGUMENT_i32_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 255, implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I64_:%[0-9]+]]:i64 = AND_I64 [[I64_EXTEND_U_I32_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I64_1:%[0-9]+]]:i64 = AND_I64 [[ARGUMENT_i64_]], [[AND_I64_]]
-    ; CHECK-NEXT: RETURN [[AND_I64_1]], implicit-def $arguments
-    %0:i64(p0)  = ARGUMENT_i64 0, implicit $arguments
-    %2:i32(i32) = ARGUMENT_i32 1, implicit $arguments
-    %1:_(i8) = G_TRUNC %2(i32)
-    %3:_(p0) = G_PTRMASK %0, %1(i8)
-    RETURN %3(p0), implicit-def $arguments
-...
-
----
-name:            ptrmask_i16
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i16
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i64_:%[0-9]+]]:i64 = ARGUMENT_i64 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i32_:%[0-9]+]]:i32 = ARGUMENT_i32 1, implicit $arguments
-    ; CHECK-NEXT: [[I64_EXTEND_U_I32_:%[0-9]+]]:i64 = I64_EXTEND_U_I32 [[ARGUMENT_i32_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 65535, implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I64_:%[0-9]+]]:i64 = AND_I64 [[I64_EXTEND_U_I32_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I64_1:%[0-9]+]]:i64 = AND_I64 [[ARGUMENT_i64_]], [[AND_I64_]]
-    ; CHECK-NEXT: RETURN [[AND_I64_1]], implicit-def $arguments
-    %0:i64(p0)  = ARGUMENT_i64 0, implicit $arguments
-    %2:i32(i32) = ARGUMENT_i32 1, implicit $arguments
-    %1:_(i16) = G_TRUNC %2(i32)
-    %3:_(p0) = G_PTRMASK %0, %1(i16)
-    RETURN %3(p0), implicit-def $arguments
-...
-
----
-name:            ptrmask_i32
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i32
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i64_:%[0-9]+]]:i64 = ARGUMENT_i64 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i32_:%[0-9]+]]:i32 = ARGUMENT_i32 1, implicit $arguments
-    ; CHECK-NEXT: [[I64_EXTEND_U_I32_:%[0-9]+]]:i64 = I64_EXTEND_U_I32 [[ARGUMENT_i32_]], implicit-def dead $arguments
-    ; CHECK-NEXT: [[AND_I64_:%[0-9]+]]:i64 = AND_I64 [[ARGUMENT_i64_]], [[I64_EXTEND_U_I32_]]
-    ; CHECK-NEXT: RETURN [[AND_I64_]], implicit-def $arguments
-    %0:i64(p0)  = ARGUMENT_i64 0, implicit $arguments
-    %1:i32(i32) = ARGUMENT_i32 1, implicit $arguments
-    %2:_(p0) = G_PTRMASK %0, %1(i32)
-    RETURN %2(p0), implicit-def $arguments
-...
-
----
-name:            ptrmask_i64
-tracksRegLiveness: true
-body:             |
-  bb.1.entry:
-    liveins: $arguments
-    ; CHECK-LABEL: name: ptrmask_i64
-    ; CHECK: liveins: $arguments
-    ; CHECK-NEXT: {{  $}}
-    ; CHECK-NEXT: [[ARGUMENT_i64_:%[0-9]+]]:i64 = ARGUMENT_i64 0, implicit $arguments
-    ; CHECK-NEXT: [[ARGUMENT_i64_1:%[0-9]+]]:i64 = ARGUMENT_i64 1, implicit $arguments
-    ; CHECK-NEXT: [[AND_I64_:%[0-9]+]]:i64 = AND_I64 [[ARGUMENT_i64_]], [[ARGUMENT_i64_1]]
-    ; CHECK-NEXT: RETURN [[AND_I64_]], implicit-def $arguments
-    %0:i64(p0)  = ARGUMENT_i64 0, implicit $arguments
-    %1:i64(i64) = ARGUMENT_i64 1, implicit $arguments
-    %2:_(p0) = G_PTRMASK %0, %1(i64)
-    RETURN %2(p0), implicit-def $arguments
-...

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrtoint.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrtoint.ll
deleted file mode 100644
index fe90bfe260f75..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/ptrtoint.ll
+++ /dev/null
@@ -1,71 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64
-
-define i8 @ptrtoint_i8(ptr %x) {
-; WASM32-LABEL: ptrtoint_i8:
-; WASM32:         .functype ptrtoint_i8 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push0=, 0
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: ptrtoint_i8:
-; WASM64:         .functype ptrtoint_i8 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.wrap_i64 $push0=, $pop1
-; WASM64-NEXT:    return $pop0
-  %a = ptrtoint ptr %x to i8
-  ret i8 %a
-}
-
-define i16 @ptrtoint_i16(ptr %x) {
-; WASM32-LABEL: ptrtoint_i16:
-; WASM32:         .functype ptrtoint_i16 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push0=, 0
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: ptrtoint_i16:
-; WASM64:         .functype ptrtoint_i16 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.wrap_i64 $push0=, $pop1
-; WASM64-NEXT:    return $pop0
-  %a = ptrtoint ptr %x to i16
-  ret i16 %a
-}
-
-define i32 @ptrtoint_i32(ptr %x) {
-; WASM32-LABEL: ptrtoint_i32:
-; WASM32:         .functype ptrtoint_i32 (i32) -> (i32)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push0=, 0
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: ptrtoint_i32:
-; WASM64:         .functype ptrtoint_i32 (i64) -> (i32)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    i32.wrap_i64 $push0=, $pop1
-; WASM64-NEXT:    return $pop0
-  %a = ptrtoint ptr %x to i32
-  ret i32 %a
-}
-
-define i64 @ptrtoint_i64(ptr %x) {
-; WASM32-LABEL: ptrtoint_i64:
-; WASM32:         .functype ptrtoint_i64 (i32) -> (i64)
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    i64.extend_i32_u $push0=, $pop1
-; WASM32-NEXT:    return $pop0
-;
-; WASM64-LABEL: ptrtoint_i64:
-; WASM64:         .functype ptrtoint_i64 (i64) -> (i64)
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push0=, 0
-; WASM64-NEXT:    return $pop0
-  %a = ptrtoint ptr %x to i64
-  ret i64 %a
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/sextload.mir b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/sextload.mir
deleted file mode 100644
index 4cee03bb95fcf..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/sextload.mir
+++ /dev/null
@@ -1,220 +0,0 @@
-# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
-# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=WASM32
-# RUN: llc -mtriple=wasm64-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=WASM64
-
----
-name: sextload_i1_i32
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i1_i32
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_U_I32_A32_:%[0-9]+]]:i32 = LOAD8_U_I32_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: [[CONST_I32_:%[0-9]+]]:i32 = CONST_I32 31, implicit-def dead $arguments
-    ; WASM32-NEXT: [[SHL_I32_:%[0-9]+]]:i32 = SHL_I32 [[LOAD8_U_I32_A32_]], [[CONST_I32_]], implicit-def dead $arguments
-    ; WASM32-NEXT: [[SHR_S_I32_:%[0-9]+]]:i32 = SHR_S_I32 [[SHL_I32_]], [[CONST_I32_]], implicit-def dead $arguments
-    ; WASM32-NEXT: RETURN [[SHR_S_I32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i1_i32
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_U_I32_A64_:%[0-9]+]]:i32 = LOAD8_U_I32_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: [[CONST_I32_:%[0-9]+]]:i32 = CONST_I32 31, implicit-def dead $arguments
-    ; WASM64-NEXT: [[SHL_I32_:%[0-9]+]]:i32 = SHL_I32 [[LOAD8_U_I32_A64_]], [[CONST_I32_]], implicit-def dead $arguments
-    ; WASM64-NEXT: [[SHR_S_I32_:%[0-9]+]]:i32 = SHR_S_I32 [[SHL_I32_]], [[CONST_I32_]], implicit-def dead $arguments
-    ; WASM64-NEXT: RETURN [[SHR_S_I32_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i32) = G_SEXTLOAD %0(p0) :: (load (i1))
-    RETURN %1(i32), implicit-def $arguments
-...
----
-name: sextload_i1_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i1_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_U_I64_A32_:%[0-9]+]]:i64 = LOAD8_U_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 63, implicit-def dead $arguments
-    ; WASM32-NEXT: [[SHL_I64_:%[0-9]+]]:i64 = SHL_I64 [[LOAD8_U_I64_A32_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM32-NEXT: [[SHR_S_I64_:%[0-9]+]]:i64 = SHR_S_I64 [[SHL_I64_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM32-NEXT: RETURN [[SHR_S_I64_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i1_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_U_I64_A64_:%[0-9]+]]:i64 = LOAD8_U_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 63, implicit-def dead $arguments
-    ; WASM64-NEXT: [[SHL_I64_:%[0-9]+]]:i64 = SHL_I64 [[LOAD8_U_I64_A64_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM64-NEXT: [[SHR_S_I64_:%[0-9]+]]:i64 = SHR_S_I64 [[SHL_I64_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM64-NEXT: RETURN [[SHR_S_I64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_SEXTLOAD %0(p0) :: (load (i1))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: sextload_i8_i32
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i8_i32
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_S_I32_A32_:%[0-9]+]]:i32 = LOAD8_S_I32_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: RETURN [[LOAD8_S_I32_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i8_i32
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_S_I32_A64_:%[0-9]+]]:i32 = LOAD8_S_I32_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: RETURN [[LOAD8_S_I32_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i32) = G_SEXTLOAD %0(p0) :: (load (i8))
-    RETURN %1(i32), implicit-def $arguments
-...
----
-name: sextload_i8_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i8_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_S_I64_A32_:%[0-9]+]]:i64 = LOAD8_S_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: RETURN [[LOAD8_S_I64_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i8_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_S_I64_A64_:%[0-9]+]]:i64 = LOAD8_S_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: RETURN [[LOAD8_S_I64_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_SEXTLOAD %0(p0) :: (load (i8))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: sextload_i16_i32
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i16_i32
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD16_S_I32_A32_:%[0-9]+]]:i32 = LOAD16_S_I32_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM32-NEXT: RETURN [[LOAD16_S_I32_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i16_i32
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD16_S_I32_A64_:%[0-9]+]]:i32 = LOAD16_S_I32_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM64-NEXT: RETURN [[LOAD16_S_I32_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i32) = G_SEXTLOAD %0(p0) :: (load (i16))
-    RETURN %1(i32), implicit-def $arguments
-...
----
-name: sextload_i16_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i16_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD16_S_I64_A32_:%[0-9]+]]:i64 = LOAD16_S_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM32-NEXT: RETURN [[LOAD16_S_I64_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i16_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD16_S_I64_A64_:%[0-9]+]]:i64 = LOAD16_S_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM64-NEXT: RETURN [[LOAD16_S_I64_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_SEXTLOAD %0(p0) :: (load (i16))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: sextload_i32_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i32_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD32_S_I64_A32_:%[0-9]+]]:i64 = LOAD32_S_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i32))
-    ; WASM32-NEXT: RETURN [[LOAD32_S_I64_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i32_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD32_S_I64_A64_:%[0-9]+]]:i64 = LOAD32_S_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i32))
-    ; WASM64-NEXT: RETURN [[LOAD32_S_I64_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_SEXTLOAD %0(p0) :: (load (i32))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: sextload_i48_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: sextload_i48_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD32_U_I64_A32_:%[0-9]+]]:i64 = LOAD32_U_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (s32), align 8)
-    ; WASM32-NEXT: [[CONST_I32_:%[0-9]+]]:i32 = CONST_I32 4, implicit-def dead $arguments
-    ; WASM32-NEXT: [[ADD_I32_:%[0-9]+]]:i32 = nuw inbounds ADD_I32 [[DEF]], [[CONST_I32_]], implicit-def dead $arguments
-    ; WASM32-NEXT: [[LOAD16_S_I64_A32_:%[0-9]+]]:i64 = LOAD16_S_I64_A32 0, 0, [[ADD_I32_]], implicit-def dead $arguments :: (load (s16) from unknown-address + 4, align 4)
-    ; WASM32-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 32, implicit-def dead $arguments
-    ; WASM32-NEXT: [[SHL_I64_:%[0-9]+]]:i64 = SHL_I64 [[LOAD16_S_I64_A32_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM32-NEXT: [[OR_I64_:%[0-9]+]]:i64 = OR_I64 [[SHL_I64_]], [[LOAD32_U_I64_A32_]], implicit-def dead $arguments
-    ; WASM32-NEXT: RETURN [[OR_I64_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: sextload_i48_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD32_U_I64_A64_:%[0-9]+]]:i64 = LOAD32_U_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (s32), align 8)
-    ; WASM64-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 4, implicit-def dead $arguments
-    ; WASM64-NEXT: [[ADD_I64_:%[0-9]+]]:i64 = nuw inbounds ADD_I64 [[DEF]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM64-NEXT: [[LOAD16_S_I64_A64_:%[0-9]+]]:i64 = LOAD16_S_I64_A64 0, 0, [[ADD_I64_]], implicit-def dead $arguments :: (load (s16) from unknown-address + 4, align 4)
-    ; WASM64-NEXT: [[CONST_I64_1:%[0-9]+]]:i64 = CONST_I64 32, implicit-def dead $arguments
-    ; WASM64-NEXT: [[SHL_I64_:%[0-9]+]]:i64 = SHL_I64 [[LOAD16_S_I64_A64_]], [[CONST_I64_1]], implicit-def dead $arguments
-    ; WASM64-NEXT: [[OR_I64_:%[0-9]+]]:i64 = OR_I64 [[SHL_I64_]], [[LOAD32_U_I64_A64_]], implicit-def dead $arguments
-    ; WASM64-NEXT: RETURN [[OR_I64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_SEXTLOAD %0(p0) :: (load (i48))
-    RETURN %1(i64), implicit-def $arguments
-...

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/store.ll b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/store.ll
deleted file mode 100644
index 2bfc59dfe37ee..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/store.ll
+++ /dev/null
@@ -1,236 +0,0 @@
-; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 6
-; RUN: llc < %s -O0 -mtriple=wasm32-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM32
-; RUN: llc < %s -O0 -mtriple=wasm64-unknown-unknown --global-isel -disable-wasm-fallthrough-return-opt -wasm-keep-registers | FileCheck %s --check-prefix=WASM64
-
-define void @store_i1(ptr %x, i1 %y) {
-; WASM32-LABEL: store_i1:
-; WASM32:         .functype store_i1 (i32, i32) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push5=, 0
-; WASM32-NEXT:    local.get $push4=, 1
-; WASM32-NEXT:    i32.const $push3=, 1
-; WASM32-NEXT:    i32.and $push0=, $pop4, $pop3
-; WASM32-NEXT:    i32.const $push1=, 1
-; WASM32-NEXT:    i32.and $push2=, $pop0, $pop1
-; WASM32-NEXT:    i32.store8 0($pop5), $pop2
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_i1:
-; WASM64:         .functype store_i1 (i64, i32) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push5=, 0
-; WASM64-NEXT:    local.get $push4=, 1
-; WASM64-NEXT:    i32.const $push3=, 1
-; WASM64-NEXT:    i32.and $push0=, $pop4, $pop3
-; WASM64-NEXT:    i32.const $push1=, 1
-; WASM64-NEXT:    i32.and $push2=, $pop0, $pop1
-; WASM64-NEXT:    i32.store8 0($pop5), $pop2
-; WASM64-NEXT:    return
-  store i1 %y, ptr %x
-  ret void
-}
-
-define void @store_i8(ptr %x, i8 %y) {
-; WASM32-LABEL: store_i8:
-; WASM32:         .functype store_i8 (i32, i32) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i32.store8 0($pop1), $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_i8:
-; WASM64:         .functype store_i8 (i64, i32) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i32.store8 0($pop1), $pop0
-; WASM64-NEXT:    return
-  store i8 %y, ptr %x
-  ret void
-}
-
-define void @store_i16(ptr %x, i16 %y) {
-; WASM32-LABEL: store_i16:
-; WASM32:         .functype store_i16 (i32, i32) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i32.store16 0($pop1), $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_i16:
-; WASM64:         .functype store_i16 (i64, i32) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i32.store16 0($pop1), $pop0
-; WASM64-NEXT:    return
-  store i16 %y, ptr %x
-  ret void
-}
-
-define void @store_i32(ptr %x, i32 %y) {
-; WASM32-LABEL: store_i32:
-; WASM32:         .functype store_i32 (i32, i32) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i32.store 0($pop1), $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_i32:
-; WASM64:         .functype store_i32 (i64, i32) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i32.store 0($pop1), $pop0
-; WASM64-NEXT:    return
-  store i32 %y, ptr %x
-  ret void
-}
-
-define void @store_i32_align1(ptr %x, i32 %y) {
-; WASM32-LABEL: store_i32_align1:
-; WASM32:         .functype store_i32_align1 (i32, i32) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i32.store 0($pop1):p2align=0, $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_i32_align1:
-; WASM64:         .functype store_i32_align1 (i64, i32) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i32.store 0($pop1):p2align=0, $pop0
-; WASM64-NEXT:    return
-  store i32 %y, ptr %x, align 1
-  ret void
-}
-
-define void @store_i48(ptr %x, i48 %y) {
-; WASM32-LABEL: store_i48:
-; WASM32:         .functype store_i48 (i32, i64) -> ()
-; WASM32-NEXT:    .local i64, i32
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push3=, 1
-; WASM32-NEXT:    i64.const $push0=, 32
-; WASM32-NEXT:    i64.shr_u $push2=, $pop3, $pop0
-; WASM32-NEXT:    local.set 2, $pop2
-; WASM32-NEXT:    local.get $push5=, 0
-; WASM32-NEXT:    i32.const $push1=, 4
-; WASM32-NEXT:    i32.add $push4=, $pop5, $pop1
-; WASM32-NEXT:    local.set 3, $pop4
-; WASM32-NEXT:    local.get $push7=, 0
-; WASM32-NEXT:    local.get $push6=, 1
-; WASM32-NEXT:    i64.store32 0($pop7), $pop6
-; WASM32-NEXT:    local.get $push9=, 3
-; WASM32-NEXT:    local.get $push8=, 2
-; WASM32-NEXT:    i64.store16 0($pop9), $pop8
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_i48:
-; WASM64:         .functype store_i48 (i64, i64) -> ()
-; WASM64-NEXT:    .local i64, i64
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push3=, 1
-; WASM64-NEXT:    i64.const $push0=, 32
-; WASM64-NEXT:    i64.shr_u $push2=, $pop3, $pop0
-; WASM64-NEXT:    local.set 2, $pop2
-; WASM64-NEXT:    local.get $push5=, 0
-; WASM64-NEXT:    i64.const $push1=, 4
-; WASM64-NEXT:    i64.add $push4=, $pop5, $pop1
-; WASM64-NEXT:    local.set 3, $pop4
-; WASM64-NEXT:    local.get $push7=, 0
-; WASM64-NEXT:    local.get $push6=, 1
-; WASM64-NEXT:    i64.store32 0($pop7), $pop6
-; WASM64-NEXT:    local.get $push9=, 3
-; WASM64-NEXT:    local.get $push8=, 2
-; WASM64-NEXT:    i64.store16 0($pop9), $pop8
-; WASM64-NEXT:    return
-  store i48 %y, ptr %x
-  ret void
-}
-
-define void @store_i64(ptr %x, i64 %y) {
-; WASM32-LABEL: store_i64:
-; WASM32:         .functype store_i64 (i32, i64) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i64.store 0($pop1), $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_i64:
-; WASM64:         .functype store_i64 (i64, i64) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i64.store 0($pop1), $pop0
-; WASM64-NEXT:    return
-  store i64 %y, ptr %x
-  ret void
-}
-
-
-define void @store_f32(ptr %x, float %y) {
-; WASM32-LABEL: store_f32:
-; WASM32:         .functype store_f32 (i32, f32) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i32.store 0($pop1), $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_f32:
-; WASM64:         .functype store_f32 (i64, f32) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i32.store 0($pop1), $pop0
-; WASM64-NEXT:    return
-  store float %y, ptr %x
-  ret void
-}
-
-define void @store_f64(ptr %x, double %y) {
-; WASM32-LABEL: store_f64:
-; WASM32:         .functype store_f64 (i32, f64) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i64.store 0($pop1), $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_f64:
-; WASM64:         .functype store_f64 (i64, f64) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i64.store 0($pop1), $pop0
-; WASM64-NEXT:    return
-  store double %y, ptr %x
-  ret void
-}
-
-define void @store_ptr(ptr %x, ptr %y) {
-; WASM32-LABEL: store_ptr:
-; WASM32:         .functype store_ptr (i32, i32) -> ()
-; WASM32-NEXT:  # %bb.0:
-; WASM32-NEXT:    local.get $push1=, 0
-; WASM32-NEXT:    local.get $push0=, 1
-; WASM32-NEXT:    i32.store 0($pop1), $pop0
-; WASM32-NEXT:    return
-;
-; WASM64-LABEL: store_ptr:
-; WASM64:         .functype store_ptr (i64, i64) -> ()
-; WASM64-NEXT:  # %bb.0:
-; WASM64-NEXT:    local.get $push1=, 0
-; WASM64-NEXT:    local.get $push0=, 1
-; WASM64-NEXT:    i64.store 0($pop1), $pop0
-; WASM64-NEXT:    return
-  store ptr %y, ptr %x
-  ret void
-}

diff  --git a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/zextload.mir b/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/zextload.mir
deleted file mode 100644
index 43e5823089d3d..0000000000000
--- a/llvm/test/CodeGen/WebAssembly/GlobalISel/instructions/zextload.mir
+++ /dev/null
@@ -1,208 +0,0 @@
-# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 6
-# RUN: llc -mtriple=wasm32-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=WASM32
-# RUN: llc -mtriple=wasm64-unknown-unknown -run-pass=legalizer,reg-bank-select,instruction-select %s -o - | FileCheck %s --check-prefixes=WASM64
-
----
-name: zextload_i1_i32
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i1_i32
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_U_I32_A32_:%[0-9]+]]:i32 = LOAD8_U_I32_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: RETURN [[LOAD8_U_I32_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i1_i32
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_U_I32_A64_:%[0-9]+]]:i32 = LOAD8_U_I32_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: RETURN [[LOAD8_U_I32_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i32) = G_ZEXTLOAD %0(p0) :: (load (i1))
-    RETURN %1(i32), implicit-def $arguments
-...
----
-name: zextload_i1_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i1_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_U_I64_A32_:%[0-9]+]]:i64 = LOAD8_U_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: RETURN [[LOAD8_U_I64_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i1_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_U_I64_A64_:%[0-9]+]]:i64 = LOAD8_U_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: RETURN [[LOAD8_U_I64_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_ZEXTLOAD %0(p0) :: (load (i1))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: zextload_i8_i32
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i8_i32
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_U_I32_A32_:%[0-9]+]]:i32 = LOAD8_U_I32_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: RETURN [[LOAD8_U_I32_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i8_i32
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_U_I32_A64_:%[0-9]+]]:i32 = LOAD8_U_I32_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: RETURN [[LOAD8_U_I32_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i32) = G_ZEXTLOAD %0(p0) :: (load (i8))
-    RETURN %1(i32), implicit-def $arguments
-...
----
-name: zextload_i8_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i8_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD8_U_I64_A32_:%[0-9]+]]:i64 = LOAD8_U_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM32-NEXT: RETURN [[LOAD8_U_I64_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i8_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD8_U_I64_A64_:%[0-9]+]]:i64 = LOAD8_U_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i8))
-    ; WASM64-NEXT: RETURN [[LOAD8_U_I64_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_ZEXTLOAD %0(p0) :: (load (i8))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: zextload_i16_i32
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i16_i32
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD16_U_I32_A32_:%[0-9]+]]:i32 = LOAD16_U_I32_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM32-NEXT: RETURN [[LOAD16_U_I32_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i16_i32
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD16_U_I32_A64_:%[0-9]+]]:i32 = LOAD16_U_I32_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM64-NEXT: RETURN [[LOAD16_U_I32_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i32) = G_ZEXTLOAD %0(p0) :: (load (i16))
-    RETURN %1(i32), implicit-def $arguments
-...
----
-name: zextload_i16_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i16_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD16_U_I64_A32_:%[0-9]+]]:i64 = LOAD16_U_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM32-NEXT: RETURN [[LOAD16_U_I64_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i16_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD16_U_I64_A64_:%[0-9]+]]:i64 = LOAD16_U_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i16))
-    ; WASM64-NEXT: RETURN [[LOAD16_U_I64_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_ZEXTLOAD %0(p0) :: (load (i16))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: zextload_i32_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i32_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD32_U_I64_A32_:%[0-9]+]]:i64 = LOAD32_U_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i32))
-    ; WASM32-NEXT: RETURN [[LOAD32_U_I64_A32_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i32_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD32_U_I64_A64_:%[0-9]+]]:i64 = LOAD32_U_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (i32))
-    ; WASM64-NEXT: RETURN [[LOAD32_U_I64_A64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_ZEXTLOAD %0(p0) :: (load (i32))
-    RETURN %1(i64), implicit-def $arguments
-...
----
-name: zextload_i48_i64
-tracksRegLiveness: true
-body: |
-  bb.1.entry:
-    liveins: $arguments
-
-    ; WASM32-LABEL: name: zextload_i48_i64
-    ; WASM32: liveins: $arguments
-    ; WASM32-NEXT: {{  $}}
-    ; WASM32-NEXT: [[DEF:%[0-9]+]]:i32 = IMPLICIT_DEF
-    ; WASM32-NEXT: [[LOAD32_U_I64_A32_:%[0-9]+]]:i64 = LOAD32_U_I64_A32 0, 0, [[DEF]], implicit-def dead $arguments :: (load (s32), align 8)
-    ; WASM32-NEXT: [[CONST_I32_:%[0-9]+]]:i32 = CONST_I32 4, implicit-def dead $arguments
-    ; WASM32-NEXT: [[ADD_I32_:%[0-9]+]]:i32 = nuw inbounds ADD_I32 [[DEF]], [[CONST_I32_]], implicit-def dead $arguments
-    ; WASM32-NEXT: [[LOAD16_U_I64_A32_:%[0-9]+]]:i64 = LOAD16_U_I64_A32 0, 0, [[ADD_I32_]], implicit-def dead $arguments :: (load (s16) from unknown-address + 4, align 4)
-    ; WASM32-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 32, implicit-def dead $arguments
-    ; WASM32-NEXT: [[SHL_I64_:%[0-9]+]]:i64 = SHL_I64 [[LOAD16_U_I64_A32_]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM32-NEXT: [[OR_I64_:%[0-9]+]]:i64 = OR_I64 [[SHL_I64_]], [[LOAD32_U_I64_A32_]], implicit-def dead $arguments
-    ; WASM32-NEXT: RETURN [[OR_I64_]], implicit-def $arguments
-    ;
-    ; WASM64-LABEL: name: zextload_i48_i64
-    ; WASM64: liveins: $arguments
-    ; WASM64-NEXT: {{  $}}
-    ; WASM64-NEXT: [[DEF:%[0-9]+]]:i64 = IMPLICIT_DEF
-    ; WASM64-NEXT: [[LOAD32_U_I64_A64_:%[0-9]+]]:i64 = LOAD32_U_I64_A64 0, 0, [[DEF]], implicit-def dead $arguments :: (load (s32), align 8)
-    ; WASM64-NEXT: [[CONST_I64_:%[0-9]+]]:i64 = CONST_I64 4, implicit-def dead $arguments
-    ; WASM64-NEXT: [[ADD_I64_:%[0-9]+]]:i64 = nuw inbounds ADD_I64 [[DEF]], [[CONST_I64_]], implicit-def dead $arguments
-    ; WASM64-NEXT: [[LOAD16_U_I64_A64_:%[0-9]+]]:i64 = LOAD16_U_I64_A64 0, 0, [[ADD_I64_]], implicit-def dead $arguments :: (load (s16) from unknown-address + 4, align 4)
-    ; WASM64-NEXT: [[CONST_I64_1:%[0-9]+]]:i64 = CONST_I64 32, implicit-def dead $arguments
-    ; WASM64-NEXT: [[SHL_I64_:%[0-9]+]]:i64 = SHL_I64 [[LOAD16_U_I64_A64_]], [[CONST_I64_1]], implicit-def dead $arguments
-    ; WASM64-NEXT: [[OR_I64_:%[0-9]+]]:i64 = OR_I64 [[SHL_I64_]], [[LOAD32_U_I64_A64_]], implicit-def dead $arguments
-    ; WASM64-NEXT: RETURN [[OR_I64_]], implicit-def $arguments
-    %0:_(p0) = G_IMPLICIT_DEF
-    %1:_(i64) = G_ZEXTLOAD %0(p0) :: (load (i48))
-    RETURN %1(i64), implicit-def $arguments
-...


        


More information about the llvm-commits mailing list