Index: lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp =================================================================== --- lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp +++ lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp @@ -34,27 +34,10 @@ namespace { -// We store register types as SimpleValueType to retain SIMD layout -// information, but must also be able to supply them as the (unnamed) -// register enum from WebAssemblyRegisterInfo.td/.inc. -static unsigned MVTToWasmReg(MVT::SimpleValueType Type) { - switch(Type) { - case MVT::i32: return WebAssembly::I32_0; - case MVT::i64: return WebAssembly::I64_0; - case MVT::f32: return WebAssembly::F32_0; - case MVT::f64: return WebAssembly::F64_0; - case MVT::v16i8: return WebAssembly::V128_0; - case MVT::v8i16: return WebAssembly::V128_0; - case MVT::v4i32: return WebAssembly::V128_0; - case MVT::v4f32: return WebAssembly::V128_0; - default: return MVT::INVALID_SIMPLE_VALUE_TYPE; - } -} - /// WebAssemblyOperand - Instances of this class represent the operands in a /// parsed WASM machine instruction. struct WebAssemblyOperand : public MCParsedAsmOperand { - enum KindTy { Token, Local, Stack, Integer, Float, Symbol } Kind; + enum KindTy { Token, Integer, Float, Symbol } Kind; SMLoc StartLoc, EndLoc; @@ -62,19 +45,6 @@ StringRef Tok; }; - struct RegOp { - // This is a (virtual) local or stack register represented as 0.. - unsigned RegNo; - // In most targets, the register number also encodes the type, but for - // wasm we have to track that seperately since we have an unbounded - // number of registers. - // This has the unfortunate side effect that we supply a different value - // to the table-gen matcher at different times in the process (when it - // calls getReg() or addRegOperands(). - // TODO: While this works, it feels brittle. and would be nice to clean up. - MVT::SimpleValueType Type; - }; - struct IntOp { int64_t Val; }; @@ -89,7 +59,6 @@ union { struct TokOp Tok; - struct RegOp Reg; struct IntOp Int; struct FltOp Flt; struct SymOp Sym; @@ -97,8 +66,6 @@ WebAssemblyOperand(KindTy K, SMLoc Start, SMLoc End, TokOp T) : Kind(K), StartLoc(Start), EndLoc(End), Tok(T) {} - WebAssemblyOperand(KindTy K, SMLoc Start, SMLoc End, RegOp R) - : Kind(K), StartLoc(Start), EndLoc(End), Reg(R) {} WebAssemblyOperand(KindTy K, SMLoc Start, SMLoc End, IntOp I) : Kind(K), StartLoc(Start), EndLoc(End), Int(I) {} WebAssemblyOperand(KindTy K, SMLoc Start, SMLoc End, FltOp F) @@ -110,14 +77,12 @@ bool isImm() const override { return Kind == Integer || Kind == Float || Kind == Symbol; } - bool isReg() const override { return Kind == Local || Kind == Stack; } bool isMem() const override { return false; } + bool isReg() const override { return false; } unsigned getReg() const override { - assert(isReg()); - // This is called from the tablegen matcher (MatchInstructionImpl) - // where it expects to match the type of register, see RegOp above. - return MVTToWasmReg(Reg.Type); + llvm_unreachable("Assembly inspects a register operand"); + return 0; } StringRef getToken() const { @@ -128,19 +93,9 @@ SMLoc getStartLoc() const override { return StartLoc; } SMLoc getEndLoc() const override { return EndLoc; } - void addRegOperands(MCInst &Inst, unsigned N) const { - assert(N == 1 && "Invalid number of operands!"); - assert(isReg() && "Not a register operand!"); - // This is called from the tablegen matcher (MatchInstructionImpl) - // where it expects to output the actual register index, see RegOp above. - unsigned R = Reg.RegNo; - if (Kind == Stack) { - // A stack register is represented as a large negative number. - // See WebAssemblyRegNumbering::runOnMachineFunction and - // getWARegStackId for why this | is needed. - R |= INT32_MIN; - } - Inst.addOperand(MCOperand::createReg(R)); + void addRegOperands(MCInst &, unsigned) const { + // Required by the assembly matcher. + llvm_unreachable("Assembly matcher creates register operands"); } void addImmOperands(MCInst &Inst, unsigned N) const { @@ -160,12 +115,6 @@ case Token: OS << "Tok:" << Tok.Tok; break; - case Local: - OS << "Loc:" << Reg.RegNo << ":" << static_cast(Reg.Type); - break; - case Stack: - OS << "Stk:" << Reg.RegNo << ":" << static_cast(Reg.Type); - break; case Integer: OS << "Int:" << Int.Val; break; @@ -182,11 +131,6 @@ class WebAssemblyAsmParser final : public MCTargetAsmParser { MCAsmParser &Parser; MCAsmLexer &Lexer; - // These are for the current function being parsed: - // These are vectors since register assignments are so far non-sparse. - // Replace by map if necessary. - std::vector LocalTypes; - std::vector StackTypes; MCSymbol *LastLabel; public: @@ -236,68 +180,6 @@ .Default(MVT::INVALID_SIMPLE_VALUE_TYPE); } - MVT::SimpleValueType &GetType( - std::vector &Types, size_t i) { - Types.resize(std::max(i + 1, Types.size()), MVT::INVALID_SIMPLE_VALUE_TYPE); - return Types[i]; - } - - bool ParseReg(OperandVector &Operands, StringRef TypePrefix) { - if (Lexer.is(AsmToken::Integer)) { - auto &Local = Lexer.getTok(); - // This is a reference to a local, turn it into a virtual register. - auto LocalNo = static_cast(Local.getIntVal()); - Operands.push_back(make_unique( - WebAssemblyOperand::Local, Local.getLoc(), - Local.getEndLoc(), - WebAssemblyOperand::RegOp{LocalNo, - GetType(LocalTypes, LocalNo)})); - Parser.Lex(); - } else if (Lexer.is(AsmToken::Identifier)) { - auto &StackRegTok = Lexer.getTok(); - // These are push/pop/drop pseudo stack registers, which we turn - // into virtual registers also. The stackify pass will later turn them - // back into implicit stack references if possible. - auto StackReg = StackRegTok.getString(); - auto StackOp = StackReg.take_while([](char c) { return isalpha(c); }); - auto Reg = StackReg.drop_front(StackOp.size()); - unsigned long long ParsedRegNo = 0; - if (!Reg.empty() && getAsUnsignedInteger(Reg, 10, ParsedRegNo)) - return Error("Cannot parse stack register index: ", StackRegTok); - unsigned RegNo = static_cast(ParsedRegNo); - if (StackOp == "push") { - // This defines a result, record register type. - auto RegType = ParseRegType(TypePrefix); - GetType(StackTypes, RegNo) = RegType; - Operands.push_back(make_unique( - WebAssemblyOperand::Stack, - StackRegTok.getLoc(), - StackRegTok.getEndLoc(), - WebAssemblyOperand::RegOp{RegNo, RegType})); - } else if (StackOp == "pop") { - // This uses a previously defined stack value. - auto RegType = GetType(StackTypes, RegNo); - Operands.push_back(make_unique( - WebAssemblyOperand::Stack, - StackRegTok.getLoc(), - StackRegTok.getEndLoc(), - WebAssemblyOperand::RegOp{RegNo, RegType})); - } else if (StackOp == "drop") { - // This operand will be dropped, since it is part of an instruction - // whose result is void. - } else { - return Error("Unknown stack register prefix: ", StackRegTok); - } - Parser.Lex(); - } else { - return Error( - "Expected identifier/integer following $, instead got: ", - Lexer.getTok()); - } - IsNext(AsmToken::Equal); - return false; - } - void ParseSingleInteger(bool IsNegative, OperandVector &Operands) { auto &Int = Lexer.getTok(); int64_t Val = Int.getIntVal(); @@ -310,36 +192,26 @@ bool ParseOperandStartingWithInteger(bool IsNegative, OperandVector &Operands, - StringRef InstType) { + StringRef InstName) { ParseSingleInteger(IsNegative, Operands); - if (Lexer.is(AsmToken::LParen)) { - // Parse load/store operands of the form: offset($reg)align - auto &LParen = Lexer.getTok(); - Operands.push_back( - make_unique(WebAssemblyOperand::Token, - LParen.getLoc(), - LParen.getEndLoc(), - WebAssemblyOperand::TokOp{ - LParen.getString()})); - Parser.Lex(); - if (Expect(AsmToken::Dollar, "register")) return true; - if (ParseReg(Operands, InstType)) return true; - auto &RParen = Lexer.getTok(); - Operands.push_back( - make_unique(WebAssemblyOperand::Token, - RParen.getLoc(), - RParen.getEndLoc(), - WebAssemblyOperand::TokOp{ - RParen.getString()})); - if (Expect(AsmToken::RParen, ")")) return true; - if (Lexer.is(AsmToken::Integer)) { + // FIXME: there is probably a cleaner way to do this. + auto IsLoadStore = InstName.startswith("load") || + InstName.startswith("store") || + InstName.startswith("atomic_load") || + InstName.startswith("atomic_store"); + if (IsLoadStore) { + // Parse load/store operands of the form: offset align + auto &Offset = Lexer.getTok(); + if (Offset.is(AsmToken::Integer)) { ParseSingleInteger(false, Operands); } else { // Alignment not specified. // FIXME: correctly derive a default from the instruction. + // We can't just call WebAssembly::GetDefaultP2Align since we don't have + // an opcode until after the assembly matcher. Operands.push_back(make_unique( - WebAssemblyOperand::Integer, RParen.getLoc(), - RParen.getEndLoc(), WebAssemblyOperand::IntOp{0})); + WebAssemblyOperand::Integer, Offset.getLoc(), + Offset.getEndLoc(), WebAssemblyOperand::IntOp{0})); } } return false; @@ -360,11 +232,6 @@ while (Lexer.isNot(AsmToken::EndOfStatement)) { auto &Tok = Lexer.getTok(); switch (Tok.getKind()) { - case AsmToken::Dollar: { - Parser.Lex(); - if (ParseReg(Operands, NamePair.first)) return true; - break; - } case AsmToken::Identifier: { auto &Id = Lexer.getTok(); const MCExpr *Val; @@ -380,11 +247,11 @@ Parser.Lex(); if (Lexer.isNot(AsmToken::Integer)) return Error("Expected integer instead got: ", Lexer.getTok()); - if (ParseOperandStartingWithInteger(true, Operands, NamePair.first)) + if (ParseOperandStartingWithInteger(true, Operands, NamePair.second)) return true; break; case AsmToken::Integer: - if (ParseOperandStartingWithInteger(false, Operands, NamePair.first)) + if (ParseOperandStartingWithInteger(false, Operands, NamePair.second)) return true; break; case AsmToken::Real: { @@ -405,35 +272,6 @@ } } Parser.Lex(); - // Call instructions are vararg, but the tablegen matcher doesn't seem to - // support that, so for now we strip these extra operands. - // This is problematic if these arguments are not simple $pop stack - // registers, since e.g. a local register would get lost, so we check for - // this. This can be the case when using -disable-wasm-explicit-locals - // which currently s2wasm requires. - // TODO: Instead, we can move this code to MatchAndEmitInstruction below and - // actually generate get_local instructions on the fly. - // Or even better, improve the matcher to support vararg? - auto IsIndirect = NamePair.second == "call_indirect"; - if (IsIndirect || NamePair.second == "call") { - // Figure out number of fixed operands from the instruction. - size_t CallOperands = 1; // The name token. - if (!IsIndirect) CallOperands++; // The function index. - if (!NamePair.first.empty()) CallOperands++; // The result register. - if (Operands.size() > CallOperands) { - // Ensure operands we drop are all $pop. - for (size_t I = CallOperands; I < Operands.size(); I++) { - auto Operand = - reinterpret_cast(Operands[I].get()); - if (Operand->Kind != WebAssemblyOperand::Stack) - Parser.Error(NameLoc, - "Call instruction has non-stack arguments, if this code was " - "generated with -disable-wasm-explicit-locals please remove it"); - } - // Drop unneeded operands. - Operands.resize(CallOperands); - } - } // Block instructions require a signature index, but these are missing in // assembly, so we add a dummy one explicitly (since we have no control // over signature tables here, we assume these will be regenerated when @@ -443,17 +281,6 @@ WebAssemblyOperand::Integer, NameLoc, NameLoc, WebAssemblyOperand::IntOp{-1})); } - // These don't specify the type, which has to derived from the local index. - if (NamePair.second == "get_local" || NamePair.second == "tee_local") { - if (Operands.size() >= 3 && Operands[1]->isReg() && - Operands[2]->isImm()) { - auto Op1 = reinterpret_cast(Operands[1].get()); - auto Op2 = reinterpret_cast(Operands[2].get()); - auto Type = GetType(LocalTypes, static_cast(Op2->Int.Val)); - Op1->Reg.Type = Type; - GetType(StackTypes, Op1->Reg.RegNo) = Type; - } - } return false; } @@ -477,11 +304,6 @@ IsNext(AsmToken::At) && Lexer.is(AsmToken::Identifier))) return Error("Expected label,@type declaration, got: ", Lexer.getTok()); - if (Lexer.getTok().getString() == "function") { - // Track locals from start of function. - LocalTypes.clear(); - StackTypes.clear(); - } Parser.Lex(); //Out.EmitSymbolAttribute(??, MCSA_ELF_TypeFunction); } else if (DirectiveID.getString() == ".param" || @@ -494,7 +316,6 @@ while (Lexer.is(AsmToken::Identifier)) { auto RegType = ParseRegType(Lexer.getTok().getString()); if (RegType == MVT::INVALID_SIMPLE_VALUE_TYPE) return true; - LocalTypes.push_back(RegType); if (DirectiveID.getString() == ".param") { Params.push_back(RegType); } else { Index: lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp =================================================================== --- lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp +++ lib/Target/WebAssembly/InstPrinter/WebAssemblyInstPrinter.cpp @@ -141,21 +141,7 @@ raw_ostream &O) { const MCOperand &Op = MI->getOperand(OpNo); if (Op.isReg()) { - assert((OpNo < MII.get(MI->getOpcode()).getNumOperands() || - MII.get(MI->getOpcode()).TSFlags == 0) && - "WebAssembly variable_ops register ops don't use TSFlags"); - unsigned WAReg = Op.getReg(); - if (int(WAReg) >= 0) - printRegName(O, WAReg); - else if (OpNo >= MII.get(MI->getOpcode()).getNumDefs()) - O << "$pop" << WebAssemblyFunctionInfo::getWARegStackId(WAReg); - else if (WAReg != WebAssemblyFunctionInfo::UnusedReg) - O << "$push" << WebAssemblyFunctionInfo::getWARegStackId(WAReg); - else - O << "$drop"; - // Add a '=' suffix if this is a def. - if (OpNo < MII.get(MI->getOpcode()).getNumDefs()) - O << '='; + llvm_unreachable("WebAssembly MCInst can't have register operands"); } else if (Op.isImm()) { const MCInstrDesc &Desc = MII.get(MI->getOpcode()); assert((OpNo < Desc.getNumOperands() || Index: lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h =================================================================== --- lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h +++ lib/Target/WebAssembly/MCTargetDesc/WebAssemblyMCTargetDesc.h @@ -125,7 +125,9 @@ case WebAssembly::STORE8_I64: case WebAssembly::STORE8_I64_S: case WebAssembly::ATOMIC_STORE8_I32: + case WebAssembly::ATOMIC_STORE8_I32_S: case WebAssembly::ATOMIC_STORE8_I64: + case WebAssembly::ATOMIC_STORE8_I64_S: return 0; case WebAssembly::LOAD16_S_I32: case WebAssembly::LOAD16_S_I32_S: @@ -144,7 +146,9 @@ case WebAssembly::STORE16_I64: case WebAssembly::STORE16_I64_S: case WebAssembly::ATOMIC_STORE16_I32: + case WebAssembly::ATOMIC_STORE16_I32_S: case WebAssembly::ATOMIC_STORE16_I64: + case WebAssembly::ATOMIC_STORE16_I64_S: return 1; case WebAssembly::LOAD_I32: case WebAssembly::LOAD_I32_S: @@ -165,7 +169,9 @@ case WebAssembly::ATOMIC_LOAD32_U_I64: case WebAssembly::ATOMIC_LOAD32_U_I64_S: case WebAssembly::ATOMIC_STORE_I32: + case WebAssembly::ATOMIC_STORE_I32_S: case WebAssembly::ATOMIC_STORE32_I64: + case WebAssembly::ATOMIC_STORE32_I64_S: return 2; case WebAssembly::LOAD_I64: case WebAssembly::LOAD_I64_S: @@ -178,6 +184,7 @@ case WebAssembly::ATOMIC_LOAD_I64: case WebAssembly::ATOMIC_LOAD_I64_S: case WebAssembly::ATOMIC_STORE_I64: + case WebAssembly::ATOMIC_STORE_I64_S: return 3; default: llvm_unreachable("Only loads and stores have p2align values"); Index: lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp =================================================================== --- lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp +++ lib/Target/WebAssembly/WebAssemblyAsmPrinter.cpp @@ -65,7 +65,7 @@ "Unlowered physical register encountered during assembly printing"); assert(!MFI->isVRegStackified(RegNo)); unsigned WAReg = MFI->getWAReg(RegNo); - assert(WAReg != WebAssemblyFunctionInfo::UnusedReg); + if (WAReg == WebAssemblyFunctionInfo::UnusedReg) return "$reg"; return '$' + utostr(WAReg); } @@ -194,42 +194,38 @@ LLVM_DEBUG(dbgs() << "EmitInstruction: " << *MI << '\n'); switch (MI->getOpcode()) { - case WebAssembly::ARGUMENT_I32: - case WebAssembly::ARGUMENT_I64: - case WebAssembly::ARGUMENT_F32: - case WebAssembly::ARGUMENT_F64: - case WebAssembly::ARGUMENT_v16i8: - case WebAssembly::ARGUMENT_v8i16: - case WebAssembly::ARGUMENT_v4i32: - case WebAssembly::ARGUMENT_v4f32: + case WebAssembly::ARGUMENT_I32_S: + case WebAssembly::ARGUMENT_I64_S: + case WebAssembly::ARGUMENT_F32_S: + case WebAssembly::ARGUMENT_F64_S: + case WebAssembly::ARGUMENT_v16i8_S: + case WebAssembly::ARGUMENT_v8i16_S: + case WebAssembly::ARGUMENT_v4i32_S: + case WebAssembly::ARGUMENT_v4f32_S: // These represent values which are live into the function entry, so there's // no instruction to emit. break; - case WebAssembly::FALLTHROUGH_RETURN_I32: - case WebAssembly::FALLTHROUGH_RETURN_I64: - case WebAssembly::FALLTHROUGH_RETURN_F32: - case WebAssembly::FALLTHROUGH_RETURN_F64: - case WebAssembly::FALLTHROUGH_RETURN_v16i8: - case WebAssembly::FALLTHROUGH_RETURN_v8i16: - case WebAssembly::FALLTHROUGH_RETURN_v4i32: - case WebAssembly::FALLTHROUGH_RETURN_v4f32: { + case WebAssembly::FALLTHROUGH_RETURN_I32_S: + case WebAssembly::FALLTHROUGH_RETURN_I64_S: + case WebAssembly::FALLTHROUGH_RETURN_F32_S: + case WebAssembly::FALLTHROUGH_RETURN_F64_S: + case WebAssembly::FALLTHROUGH_RETURN_v16i8_S: + case WebAssembly::FALLTHROUGH_RETURN_v8i16_S: + case WebAssembly::FALLTHROUGH_RETURN_v4i32_S: + case WebAssembly::FALLTHROUGH_RETURN_v4f32_S: { // These instructions represent the implicit return at the end of a - // function body. The operand is always a pop. - assert(MFI->isVRegStackified(MI->getOperand(0).getReg())); - + // function body. Always pops one value off the stack. if (isVerbose()) { - OutStreamer->AddComment("fallthrough-return: $pop" + - Twine(MFI->getWARegStackId( - MFI->getWAReg(MI->getOperand(0).getReg())))); + OutStreamer->AddComment("fallthrough-return-value"); OutStreamer->AddBlankLine(); } break; } - case WebAssembly::FALLTHROUGH_RETURN_VOID: + case WebAssembly::FALLTHROUGH_RETURN_VOID_S: // This instruction represents the implicit return at the end of a // function body with no return value. if (isVerbose()) { - OutStreamer->AddComment("fallthrough-return"); + OutStreamer->AddComment("fallthrough-return-void"); OutStreamer->AddBlankLine(); } break; @@ -270,6 +266,9 @@ OS << MO.getImm(); return false; case MachineOperand::MO_Register: + // FIXME: only opcode that still contains registers, as required by + // MachineInstr::getDebugVariable(). Ca + assert(MI->getOpcode() == WebAssembly::INLINEASM); OS << regToString(MO); return false; case MachineOperand::MO_GlobalAddress: Index: lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp =================================================================== --- lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp +++ lib/Target/WebAssembly/WebAssemblyExplicitLocals.cpp @@ -31,14 +31,6 @@ #define DEBUG_TYPE "wasm-explicit-locals" -// A command-line option to disable this pass. Note that this produces output -// which is not valid WebAssembly, though it may be more convenient for writing -// LLVM unit tests with. -static cl::opt DisableWebAssemblyExplicitLocals( - "disable-wasm-explicit-locals", cl::ReallyHidden, - cl::desc("WebAssembly: Disable emission of get_local/set_local."), - cl::init(false)); - namespace { class WebAssemblyExplicitLocals final : public MachineFunctionPass { StringRef getPassName() const override { @@ -59,6 +51,8 @@ }; } // end anonymous namespace +unsigned regInstructionToStackInstruction(unsigned OpCode); + char WebAssemblyExplicitLocals::ID = 0; INITIALIZE_PASS(WebAssemblyExplicitLocals, DEBUG_TYPE, "Convert registers to WebAssembly locals", false, false) @@ -162,7 +156,7 @@ /// Given a MachineOperand of a stackified vreg, return the instruction at the /// start of the expression tree. -static MachineInstr *FindStartOfTree(MachineOperand &MO, +static MachineInstr *findStartOfTree(MachineOperand &MO, MachineRegisterInfo &MRI, WebAssemblyFunctionInfo &MFI) { unsigned Reg = MO.getReg(); @@ -173,7 +167,7 @@ for (MachineOperand &DefMO : Def->explicit_uses()) { if (!DefMO.isReg()) continue; - return FindStartOfTree(DefMO, MRI, MFI); + return findStartOfTree(DefMO, MRI, MFI); } // If there were no stackified uses, we've reached the start. @@ -185,15 +179,6 @@ "********** Function: " << MF.getName() << '\n'); - // Disable this pass if directed to do so. - if (DisableWebAssemblyExplicitLocals) - return false; - - // Disable this pass if we aren't doing direct wasm object emission. - if (MF.getSubtarget() - .getTargetTriple().isOSBinFormatELF()) - return false; - bool Changed = false; MachineRegisterInfo &MRI = MF.getRegInfo(); WebAssemblyFunctionInfo &MFI = *MF.getInfo(); @@ -211,19 +196,19 @@ break; unsigned Reg = MI.getOperand(0).getReg(); assert(!MFI.isVRegStackified(Reg)); - Reg2Local[Reg] = MI.getOperand(1).getImm(); + Reg2Local[Reg] = static_cast(MI.getOperand(1).getImm()); MI.eraseFromParent(); Changed = true; } // Start assigning local numbers after the last parameter. - unsigned CurLocal = MFI.getParams().size(); + unsigned CurLocal = static_cast(MFI.getParams().size()); // Precompute the set of registers that are unused, so that we can insert // drops to their defs. BitVector UseEmpty(MRI.getNumVirtRegs()); - for (unsigned i = 0, e = MRI.getNumVirtRegs(); i < e; ++i) - UseEmpty[i] = MRI.use_empty(TargetRegisterInfo::index2VirtReg(i)); + for (unsigned I = 0, E = MRI.getNumVirtRegs(); I < E; ++I) + UseEmpty[I] = MRI.use_empty(TargetRegisterInfo::index2VirtReg(I)); // Visit each instruction in the function. for (MachineBasicBlock &MBB : MF) { @@ -231,7 +216,7 @@ MachineInstr &MI = *I++; assert(!WebAssembly::isArgument(MI)); - if (MI.isDebugInstr() || MI.isLabel()) + if (MI.isDebugInstr() || MI.isLabel() || MI.isInlineAsm()) continue; // Replace tee instructions with tee_local. The difference is that tee @@ -327,7 +312,7 @@ // If we see a stackified register, prepare to insert subsequent // get_locals before the start of its tree. if (MFI.isVRegStackified(OldReg)) { - InsertPt = FindStartOfTree(MO, MRI, MFI); + InsertPt = findStartOfTree(MO, MRI, MFI); continue; } @@ -361,37 +346,407 @@ Changed = true; } } + + // Remove all uses of stackified registers to bring the instruction format + // into its final stack form, and transition opcodes to their _S variant. + // We do this in a seperate loop, since the previous loop adds/removes + // instructions. + // See comments in lib/Target/WebAssembly/WebAssemblyInstrFormats.td for + // details. + // TODO: the code above creates new registers which are then removed here. + // That code could be slightly simplified by not doing that, though maybe + // it is simpler conceptually to keep the code above in "register mode" + // until this transition point. + for (MachineBasicBlock::iterator I = MBB.begin(), E = MBB.end(); I != E;) { + MachineInstr &MI = *I++; + // FIXME: we are not processing inline assembly, which contains register + // operands, because it is used by later target generic code. + if (MI.isDebugInstr() || MI.isLabel() || MI.isInlineAsm()) + continue; + auto RegOpcode = MI.getOpcode(); + auto StackOpcode = regInstructionToStackInstruction(RegOpcode); + MI.setDesc(TII->get(StackOpcode)); + // Now remove all register operands. + for (auto I = MI.getNumOperands(); I; --I) { + auto &MO = MI.getOperand(I - 1); + if (MO.isReg()) { + MI.RemoveOperand(I - 1); + // TODO: we should also update the MFI here or below to reflect the + // removed registers? The MFI is about to be deleted anyway, so maybe + // that is not worth it? + } + } + } } // Define the locals. // TODO: Sort the locals for better compression. MFI.setNumLocals(CurLocal - MFI.getParams().size()); - for (size_t i = 0, e = MRI.getNumVirtRegs(); i < e; ++i) { - unsigned Reg = TargetRegisterInfo::index2VirtReg(i); - auto I = Reg2Local.find(Reg); - if (I == Reg2Local.end() || I->second < MFI.getParams().size()) + for (unsigned I = 0, E = MRI.getNumVirtRegs(); I < E; ++I) { + unsigned Reg = TargetRegisterInfo::index2VirtReg(I); + auto RL = Reg2Local.find(Reg); + if (RL == Reg2Local.end() || RL->second < MFI.getParams().size()) continue; - MFI.setLocal(I->second - MFI.getParams().size(), + MFI.setLocal(RL->second - MFI.getParams().size(), typeForRegClass(MRI.getRegClass(Reg))); Changed = true; } -#ifndef NDEBUG - // Assert that all registers have been stackified at this point. - for (const MachineBasicBlock &MBB : MF) { - for (const MachineInstr &MI : MBB) { - if (MI.isDebugInstr() || MI.isLabel()) - continue; - for (const MachineOperand &MO : MI.explicit_operands()) { - assert( - (!MO.isReg() || MRI.use_empty(MO.getReg()) || - MFI.isVRegStackified(MO.getReg())) && - "WebAssemblyExplicitLocals failed to stackify a register operand"); - } - } - } -#endif - return Changed; } + +unsigned regInstructionToStackInstruction(unsigned OpCode) { + switch (OpCode) { + default: + // You may hit this if you add new instructions, please add them below. + // For most of these opcodes, this function could have been implemented + // as "return OpCode + 1", but since table-gen alphabetically sorts them, + // this cannot be guaranteed (see e.g. BR and BR_IF). + // The approach below is the same as what the x87 backend does. + // TODO(wvo): to make this code cleaner, create a custom tablegen + // code generator that emits the table below automatically. + llvm_unreachable( + "unknown WebAssembly instruction in Explicit Locals pass"); + case WebAssembly::ABS_F32: return WebAssembly::ABS_F32_S; + case WebAssembly::ABS_F64: return WebAssembly::ABS_F64_S; + case WebAssembly::ADD_F32: return WebAssembly::ADD_F32_S; + case WebAssembly::ADD_F32x4: return WebAssembly::ADD_F32x4_S; + case WebAssembly::ADD_F64: return WebAssembly::ADD_F64_S; + case WebAssembly::ADD_I16x8: return WebAssembly::ADD_I16x8_S; + case WebAssembly::ADD_I32: return WebAssembly::ADD_I32_S; + case WebAssembly::ADD_I32x4: return WebAssembly::ADD_I32x4_S; + case WebAssembly::ADD_I64: return WebAssembly::ADD_I64_S; + case WebAssembly::ADD_I8x16: return WebAssembly::ADD_I8x16_S; + case WebAssembly::ADJCALLSTACKDOWN: return WebAssembly::ADJCALLSTACKDOWN_S; + case WebAssembly::ADJCALLSTACKUP: return WebAssembly::ADJCALLSTACKUP_S; + case WebAssembly::AND_I32: return WebAssembly::AND_I32_S; + case WebAssembly::AND_I64: return WebAssembly::AND_I64_S; + case WebAssembly::ARGUMENT_EXCEPT_REF: return WebAssembly::ARGUMENT_EXCEPT_REF_S; + case WebAssembly::ARGUMENT_F32: return WebAssembly::ARGUMENT_F32_S; + case WebAssembly::ARGUMENT_F64: return WebAssembly::ARGUMENT_F64_S; + case WebAssembly::ARGUMENT_I32: return WebAssembly::ARGUMENT_I32_S; + case WebAssembly::ARGUMENT_I64: return WebAssembly::ARGUMENT_I64_S; + case WebAssembly::ARGUMENT_v16i8: return WebAssembly::ARGUMENT_v16i8_S; + case WebAssembly::ARGUMENT_v4f32: return WebAssembly::ARGUMENT_v4f32_S; + case WebAssembly::ARGUMENT_v4i32: return WebAssembly::ARGUMENT_v4i32_S; + case WebAssembly::ARGUMENT_v8i16: return WebAssembly::ARGUMENT_v8i16_S; + case WebAssembly::ATOMIC_LOAD16_U_I32: return WebAssembly::ATOMIC_LOAD16_U_I32_S; + case WebAssembly::ATOMIC_LOAD16_U_I64: return WebAssembly::ATOMIC_LOAD16_U_I64_S; + case WebAssembly::ATOMIC_LOAD32_U_I64: return WebAssembly::ATOMIC_LOAD32_U_I64_S; + case WebAssembly::ATOMIC_LOAD8_U_I32: return WebAssembly::ATOMIC_LOAD8_U_I32_S; + case WebAssembly::ATOMIC_LOAD8_U_I64: return WebAssembly::ATOMIC_LOAD8_U_I64_S; + case WebAssembly::ATOMIC_LOAD_I32: return WebAssembly::ATOMIC_LOAD_I32_S; + case WebAssembly::ATOMIC_LOAD_I64: return WebAssembly::ATOMIC_LOAD_I64_S; + case WebAssembly::ATOMIC_STORE16_I32: return WebAssembly::ATOMIC_STORE16_I32_S; + case WebAssembly::ATOMIC_STORE16_I64: return WebAssembly::ATOMIC_STORE16_I64_S; + case WebAssembly::ATOMIC_STORE32_I64: return WebAssembly::ATOMIC_STORE32_I64_S; + case WebAssembly::ATOMIC_STORE8_I32: return WebAssembly::ATOMIC_STORE8_I32_S; + case WebAssembly::ATOMIC_STORE8_I64: return WebAssembly::ATOMIC_STORE8_I64_S; + case WebAssembly::ATOMIC_STORE_I32: return WebAssembly::ATOMIC_STORE_I32_S; + case WebAssembly::ATOMIC_STORE_I64: return WebAssembly::ATOMIC_STORE_I64_S; + case WebAssembly::BLOCK: return WebAssembly::BLOCK_S; + case WebAssembly::BR: return WebAssembly::BR_S; + case WebAssembly::BR_IF: return WebAssembly::BR_IF_S; + case WebAssembly::BR_TABLE_I32: return WebAssembly::BR_TABLE_I32_S; + case WebAssembly::BR_TABLE_I64: return WebAssembly::BR_TABLE_I64_S; + case WebAssembly::BR_UNLESS: return WebAssembly::BR_UNLESS_S; + case WebAssembly::CALL_EXCEPT_REF: return WebAssembly::CALL_EXCEPT_REF_S; + case WebAssembly::CALL_F32: return WebAssembly::CALL_F32_S; + case WebAssembly::CALL_F64: return WebAssembly::CALL_F64_S; + case WebAssembly::CALL_I32: return WebAssembly::CALL_I32_S; + case WebAssembly::CALL_I64: return WebAssembly::CALL_I64_S; + case WebAssembly::CALL_INDIRECT_EXCEPT_REF: return WebAssembly::CALL_INDIRECT_EXCEPT_REF_S; + case WebAssembly::CALL_INDIRECT_F32: return WebAssembly::CALL_INDIRECT_F32_S; + case WebAssembly::CALL_INDIRECT_F64: return WebAssembly::CALL_INDIRECT_F64_S; + case WebAssembly::CALL_INDIRECT_I32: return WebAssembly::CALL_INDIRECT_I32_S; + case WebAssembly::CALL_INDIRECT_I64: return WebAssembly::CALL_INDIRECT_I64_S; + case WebAssembly::CALL_INDIRECT_VOID: return WebAssembly::CALL_INDIRECT_VOID_S; + case WebAssembly::CALL_INDIRECT_v16i8: return WebAssembly::CALL_INDIRECT_v16i8_S; + case WebAssembly::CALL_INDIRECT_v4f32: return WebAssembly::CALL_INDIRECT_v4f32_S; + case WebAssembly::CALL_INDIRECT_v4i32: return WebAssembly::CALL_INDIRECT_v4i32_S; + case WebAssembly::CALL_INDIRECT_v8i16: return WebAssembly::CALL_INDIRECT_v8i16_S; + case WebAssembly::CALL_VOID: return WebAssembly::CALL_VOID_S; + case WebAssembly::CALL_v16i8: return WebAssembly::CALL_v16i8_S; + case WebAssembly::CALL_v4f32: return WebAssembly::CALL_v4f32_S; + case WebAssembly::CALL_v4i32: return WebAssembly::CALL_v4i32_S; + case WebAssembly::CALL_v8i16: return WebAssembly::CALL_v8i16_S; + case WebAssembly::CATCHRET: return WebAssembly::CATCHRET_S; + case WebAssembly::CATCH_ALL: return WebAssembly::CATCH_ALL_S; + case WebAssembly::CATCH_I32: return WebAssembly::CATCH_I32_S; + case WebAssembly::CATCH_I64: return WebAssembly::CATCH_I64_S; + case WebAssembly::CEIL_F32: return WebAssembly::CEIL_F32_S; + case WebAssembly::CEIL_F64: return WebAssembly::CEIL_F64_S; + case WebAssembly::CLEANUPRET: return WebAssembly::CLEANUPRET_S; + case WebAssembly::CLZ_I32: return WebAssembly::CLZ_I32_S; + case WebAssembly::CLZ_I64: return WebAssembly::CLZ_I64_S; + case WebAssembly::CONST_F32: return WebAssembly::CONST_F32_S; + case WebAssembly::CONST_F64: return WebAssembly::CONST_F64_S; + case WebAssembly::CONST_I32: return WebAssembly::CONST_I32_S; + case WebAssembly::CONST_I64: return WebAssembly::CONST_I64_S; + case WebAssembly::COPYSIGN_F32: return WebAssembly::COPYSIGN_F32_S; + case WebAssembly::COPYSIGN_F64: return WebAssembly::COPYSIGN_F64_S; + case WebAssembly::COPY_EXCEPT_REF: return WebAssembly::COPY_EXCEPT_REF_S; + case WebAssembly::COPY_F32: return WebAssembly::COPY_F32_S; + case WebAssembly::COPY_F64: return WebAssembly::COPY_F64_S; + case WebAssembly::COPY_I32: return WebAssembly::COPY_I32_S; + case WebAssembly::COPY_I64: return WebAssembly::COPY_I64_S; + case WebAssembly::COPY_V128: return WebAssembly::COPY_V128_S; + case WebAssembly::CTZ_I32: return WebAssembly::CTZ_I32_S; + case WebAssembly::CTZ_I64: return WebAssembly::CTZ_I64_S; + case WebAssembly::CURRENT_MEMORY_I32: return WebAssembly::CURRENT_MEMORY_I32_S; + case WebAssembly::DIV_F32: return WebAssembly::DIV_F32_S; + case WebAssembly::DIV_F64: return WebAssembly::DIV_F64_S; + case WebAssembly::DIV_S_I32: return WebAssembly::DIV_S_I32_S; + case WebAssembly::DIV_S_I64: return WebAssembly::DIV_S_I64_S; + case WebAssembly::DIV_U_I32: return WebAssembly::DIV_U_I32_S; + case WebAssembly::DIV_U_I64: return WebAssembly::DIV_U_I64_S; + case WebAssembly::DROP_EXCEPT_REF: return WebAssembly::DROP_EXCEPT_REF_S; + case WebAssembly::DROP_F32: return WebAssembly::DROP_F32_S; + case WebAssembly::DROP_F64: return WebAssembly::DROP_F64_S; + case WebAssembly::DROP_I32: return WebAssembly::DROP_I32_S; + case WebAssembly::DROP_I64: return WebAssembly::DROP_I64_S; + case WebAssembly::DROP_V128: return WebAssembly::DROP_V128_S; + case WebAssembly::END_BLOCK: return WebAssembly::END_BLOCK_S; + case WebAssembly::END_FUNCTION: return WebAssembly::END_FUNCTION_S; + case WebAssembly::END_LOOP: return WebAssembly::END_LOOP_S; + case WebAssembly::END_TRY: return WebAssembly::END_TRY_S; + case WebAssembly::EQZ_I32: return WebAssembly::EQZ_I32_S; + case WebAssembly::EQZ_I64: return WebAssembly::EQZ_I64_S; + case WebAssembly::EQ_F32: return WebAssembly::EQ_F32_S; + case WebAssembly::EQ_F64: return WebAssembly::EQ_F64_S; + case WebAssembly::EQ_I32: return WebAssembly::EQ_I32_S; + case WebAssembly::EQ_I64: return WebAssembly::EQ_I64_S; + case WebAssembly::F32_CONVERT_S_I32: return WebAssembly::F32_CONVERT_S_I32_S; + case WebAssembly::F32_CONVERT_S_I64: return WebAssembly::F32_CONVERT_S_I64_S; + case WebAssembly::F32_CONVERT_U_I32: return WebAssembly::F32_CONVERT_U_I32_S; + case WebAssembly::F32_CONVERT_U_I64: return WebAssembly::F32_CONVERT_U_I64_S; + case WebAssembly::F32_DEMOTE_F64: return WebAssembly::F32_DEMOTE_F64_S; + case WebAssembly::F32_REINTERPRET_I32: return WebAssembly::F32_REINTERPRET_I32_S; + case WebAssembly::F64_CONVERT_S_I32: return WebAssembly::F64_CONVERT_S_I32_S; + case WebAssembly::F64_CONVERT_S_I64: return WebAssembly::F64_CONVERT_S_I64_S; + case WebAssembly::F64_CONVERT_U_I32: return WebAssembly::F64_CONVERT_U_I32_S; + case WebAssembly::F64_CONVERT_U_I64: return WebAssembly::F64_CONVERT_U_I64_S; + case WebAssembly::F64_PROMOTE_F32: return WebAssembly::F64_PROMOTE_F32_S; + case WebAssembly::F64_REINTERPRET_I64: return WebAssembly::F64_REINTERPRET_I64_S; + case WebAssembly::FALLTHROUGH_RETURN_EXCEPT_REF: return WebAssembly::FALLTHROUGH_RETURN_EXCEPT_REF_S; + case WebAssembly::FALLTHROUGH_RETURN_F32: return WebAssembly::FALLTHROUGH_RETURN_F32_S; + case WebAssembly::FALLTHROUGH_RETURN_F64: return WebAssembly::FALLTHROUGH_RETURN_F64_S; + case WebAssembly::FALLTHROUGH_RETURN_I32: return WebAssembly::FALLTHROUGH_RETURN_I32_S; + case WebAssembly::FALLTHROUGH_RETURN_I64: return WebAssembly::FALLTHROUGH_RETURN_I64_S; + case WebAssembly::FALLTHROUGH_RETURN_VOID: return WebAssembly::FALLTHROUGH_RETURN_VOID_S; + case WebAssembly::FALLTHROUGH_RETURN_v16i8: return WebAssembly::FALLTHROUGH_RETURN_v16i8_S; + case WebAssembly::FALLTHROUGH_RETURN_v4f32: return WebAssembly::FALLTHROUGH_RETURN_v4f32_S; + case WebAssembly::FALLTHROUGH_RETURN_v4i32: return WebAssembly::FALLTHROUGH_RETURN_v4i32_S; + case WebAssembly::FALLTHROUGH_RETURN_v8i16: return WebAssembly::FALLTHROUGH_RETURN_v8i16_S; + case WebAssembly::FLOOR_F32: return WebAssembly::FLOOR_F32_S; + case WebAssembly::FLOOR_F64: return WebAssembly::FLOOR_F64_S; + case WebAssembly::FP_TO_SINT_I32_F32: return WebAssembly::FP_TO_SINT_I32_F32_S; + case WebAssembly::FP_TO_SINT_I32_F64: return WebAssembly::FP_TO_SINT_I32_F64_S; + case WebAssembly::FP_TO_SINT_I64_F32: return WebAssembly::FP_TO_SINT_I64_F32_S; + case WebAssembly::FP_TO_SINT_I64_F64: return WebAssembly::FP_TO_SINT_I64_F64_S; + case WebAssembly::FP_TO_UINT_I32_F32: return WebAssembly::FP_TO_UINT_I32_F32_S; + case WebAssembly::FP_TO_UINT_I32_F64: return WebAssembly::FP_TO_UINT_I32_F64_S; + case WebAssembly::FP_TO_UINT_I64_F32: return WebAssembly::FP_TO_UINT_I64_F32_S; + case WebAssembly::FP_TO_UINT_I64_F64: return WebAssembly::FP_TO_UINT_I64_F64_S; + case WebAssembly::GET_GLOBAL_EXCEPT_REF: return WebAssembly::GET_GLOBAL_EXCEPT_REF_S; + case WebAssembly::GET_GLOBAL_F32: return WebAssembly::GET_GLOBAL_F32_S; + case WebAssembly::GET_GLOBAL_F64: return WebAssembly::GET_GLOBAL_F64_S; + case WebAssembly::GET_GLOBAL_I32: return WebAssembly::GET_GLOBAL_I32_S; + case WebAssembly::GET_GLOBAL_I64: return WebAssembly::GET_GLOBAL_I64_S; + case WebAssembly::GET_GLOBAL_V128: return WebAssembly::GET_GLOBAL_V128_S; + case WebAssembly::GET_LOCAL_EXCEPT_REF: return WebAssembly::GET_LOCAL_EXCEPT_REF_S; + case WebAssembly::GET_LOCAL_F32: return WebAssembly::GET_LOCAL_F32_S; + case WebAssembly::GET_LOCAL_F64: return WebAssembly::GET_LOCAL_F64_S; + case WebAssembly::GET_LOCAL_I32: return WebAssembly::GET_LOCAL_I32_S; + case WebAssembly::GET_LOCAL_I64: return WebAssembly::GET_LOCAL_I64_S; + case WebAssembly::GET_LOCAL_V128: return WebAssembly::GET_LOCAL_V128_S; + case WebAssembly::GE_F32: return WebAssembly::GE_F32_S; + case WebAssembly::GE_F64: return WebAssembly::GE_F64_S; + case WebAssembly::GE_S_I32: return WebAssembly::GE_S_I32_S; + case WebAssembly::GE_S_I64: return WebAssembly::GE_S_I64_S; + case WebAssembly::GE_U_I32: return WebAssembly::GE_U_I32_S; + case WebAssembly::GE_U_I64: return WebAssembly::GE_U_I64_S; + case WebAssembly::GROW_MEMORY_I32: return WebAssembly::GROW_MEMORY_I32_S; + case WebAssembly::GT_F32: return WebAssembly::GT_F32_S; + case WebAssembly::GT_F64: return WebAssembly::GT_F64_S; + case WebAssembly::GT_S_I32: return WebAssembly::GT_S_I32_S; + case WebAssembly::GT_S_I64: return WebAssembly::GT_S_I64_S; + case WebAssembly::GT_U_I32: return WebAssembly::GT_U_I32_S; + case WebAssembly::GT_U_I64: return WebAssembly::GT_U_I64_S; + case WebAssembly::I32_EXTEND16_S_I32: return WebAssembly::I32_EXTEND16_S_I32_S; + case WebAssembly::I32_EXTEND8_S_I32: return WebAssembly::I32_EXTEND8_S_I32_S; + case WebAssembly::I32_REINTERPRET_F32: return WebAssembly::I32_REINTERPRET_F32_S; + case WebAssembly::I32_TRUNC_S_F32: return WebAssembly::I32_TRUNC_S_F32_S; + case WebAssembly::I32_TRUNC_S_F64: return WebAssembly::I32_TRUNC_S_F64_S; + case WebAssembly::I32_TRUNC_S_SAT_F32: return WebAssembly::I32_TRUNC_S_SAT_F32_S; + case WebAssembly::I32_TRUNC_S_SAT_F64: return WebAssembly::I32_TRUNC_S_SAT_F64_S; + case WebAssembly::I32_TRUNC_U_F32: return WebAssembly::I32_TRUNC_U_F32_S; + case WebAssembly::I32_TRUNC_U_F64: return WebAssembly::I32_TRUNC_U_F64_S; + case WebAssembly::I32_TRUNC_U_SAT_F32: return WebAssembly::I32_TRUNC_U_SAT_F32_S; + case WebAssembly::I32_TRUNC_U_SAT_F64: return WebAssembly::I32_TRUNC_U_SAT_F64_S; + case WebAssembly::I32_WRAP_I64: return WebAssembly::I32_WRAP_I64_S; + case WebAssembly::I64_EXTEND16_S_I64: return WebAssembly::I64_EXTEND16_S_I64_S; + case WebAssembly::I64_EXTEND32_S_I64: return WebAssembly::I64_EXTEND32_S_I64_S; + case WebAssembly::I64_EXTEND8_S_I64: return WebAssembly::I64_EXTEND8_S_I64_S; + case WebAssembly::I64_EXTEND_S_I32: return WebAssembly::I64_EXTEND_S_I32_S; + case WebAssembly::I64_EXTEND_U_I32: return WebAssembly::I64_EXTEND_U_I32_S; + case WebAssembly::I64_REINTERPRET_F64: return WebAssembly::I64_REINTERPRET_F64_S; + case WebAssembly::I64_TRUNC_S_F32: return WebAssembly::I64_TRUNC_S_F32_S; + case WebAssembly::I64_TRUNC_S_F64: return WebAssembly::I64_TRUNC_S_F64_S; + case WebAssembly::I64_TRUNC_S_SAT_F32: return WebAssembly::I64_TRUNC_S_SAT_F32_S; + case WebAssembly::I64_TRUNC_S_SAT_F64: return WebAssembly::I64_TRUNC_S_SAT_F64_S; + case WebAssembly::I64_TRUNC_U_F32: return WebAssembly::I64_TRUNC_U_F32_S; + case WebAssembly::I64_TRUNC_U_F64: return WebAssembly::I64_TRUNC_U_F64_S; + case WebAssembly::I64_TRUNC_U_SAT_F32: return WebAssembly::I64_TRUNC_U_SAT_F32_S; + case WebAssembly::I64_TRUNC_U_SAT_F64: return WebAssembly::I64_TRUNC_U_SAT_F64_S; + case WebAssembly::LE_F32: return WebAssembly::LE_F32_S; + case WebAssembly::LE_F64: return WebAssembly::LE_F64_S; + case WebAssembly::LE_S_I32: return WebAssembly::LE_S_I32_S; + case WebAssembly::LE_S_I64: return WebAssembly::LE_S_I64_S; + case WebAssembly::LE_U_I32: return WebAssembly::LE_U_I32_S; + case WebAssembly::LE_U_I64: return WebAssembly::LE_U_I64_S; + case WebAssembly::LOAD16_S_I32: return WebAssembly::LOAD16_S_I32_S; + case WebAssembly::LOAD16_S_I64: return WebAssembly::LOAD16_S_I64_S; + case WebAssembly::LOAD16_U_I32: return WebAssembly::LOAD16_U_I32_S; + case WebAssembly::LOAD16_U_I64: return WebAssembly::LOAD16_U_I64_S; + case WebAssembly::LOAD32_S_I64: return WebAssembly::LOAD32_S_I64_S; + case WebAssembly::LOAD32_U_I64: return WebAssembly::LOAD32_U_I64_S; + case WebAssembly::LOAD8_S_I32: return WebAssembly::LOAD8_S_I32_S; + case WebAssembly::LOAD8_S_I64: return WebAssembly::LOAD8_S_I64_S; + case WebAssembly::LOAD8_U_I32: return WebAssembly::LOAD8_U_I32_S; + case WebAssembly::LOAD8_U_I64: return WebAssembly::LOAD8_U_I64_S; + case WebAssembly::LOAD_F32: return WebAssembly::LOAD_F32_S; + case WebAssembly::LOAD_F64: return WebAssembly::LOAD_F64_S; + case WebAssembly::LOAD_I32: return WebAssembly::LOAD_I32_S; + case WebAssembly::LOAD_I64: return WebAssembly::LOAD_I64_S; + case WebAssembly::LOOP: return WebAssembly::LOOP_S; + case WebAssembly::LT_F32: return WebAssembly::LT_F32_S; + case WebAssembly::LT_F64: return WebAssembly::LT_F64_S; + case WebAssembly::LT_S_I32: return WebAssembly::LT_S_I32_S; + case WebAssembly::LT_S_I64: return WebAssembly::LT_S_I64_S; + case WebAssembly::LT_U_I32: return WebAssembly::LT_U_I32_S; + case WebAssembly::LT_U_I64: return WebAssembly::LT_U_I64_S; + case WebAssembly::MAX_F32: return WebAssembly::MAX_F32_S; + case WebAssembly::MAX_F64: return WebAssembly::MAX_F64_S; + case WebAssembly::MEMORY_GROW_I32: return WebAssembly::MEMORY_GROW_I32_S; + case WebAssembly::MEMORY_SIZE_I32: return WebAssembly::MEMORY_SIZE_I32_S; + case WebAssembly::MEM_GROW_I32: return WebAssembly::MEM_GROW_I32_S; + case WebAssembly::MEM_SIZE_I32: return WebAssembly::MEM_SIZE_I32_S; + case WebAssembly::MIN_F32: return WebAssembly::MIN_F32_S; + case WebAssembly::MIN_F64: return WebAssembly::MIN_F64_S; + case WebAssembly::MUL_F32: return WebAssembly::MUL_F32_S; + case WebAssembly::MUL_F32x4: return WebAssembly::MUL_F32x4_S; + case WebAssembly::MUL_F64: return WebAssembly::MUL_F64_S; + case WebAssembly::MUL_I16x8: return WebAssembly::MUL_I16x8_S; + case WebAssembly::MUL_I32: return WebAssembly::MUL_I32_S; + case WebAssembly::MUL_I32x4: return WebAssembly::MUL_I32x4_S; + case WebAssembly::MUL_I64: return WebAssembly::MUL_I64_S; + case WebAssembly::MUL_I8x16: return WebAssembly::MUL_I8x16_S; + case WebAssembly::NEAREST_F32: return WebAssembly::NEAREST_F32_S; + case WebAssembly::NEAREST_F64: return WebAssembly::NEAREST_F64_S; + case WebAssembly::NEG_F32: return WebAssembly::NEG_F32_S; + case WebAssembly::NEG_F64: return WebAssembly::NEG_F64_S; + case WebAssembly::NE_F32: return WebAssembly::NE_F32_S; + case WebAssembly::NE_F64: return WebAssembly::NE_F64_S; + case WebAssembly::NE_I32: return WebAssembly::NE_I32_S; + case WebAssembly::NE_I64: return WebAssembly::NE_I64_S; + case WebAssembly::NOP: return WebAssembly::NOP_S; + case WebAssembly::OR_I32: return WebAssembly::OR_I32_S; + case WebAssembly::OR_I64: return WebAssembly::OR_I64_S; + case WebAssembly::PCALL_INDIRECT_EXCEPT_REF: return WebAssembly::PCALL_INDIRECT_EXCEPT_REF_S; + case WebAssembly::PCALL_INDIRECT_F32: return WebAssembly::PCALL_INDIRECT_F32_S; + case WebAssembly::PCALL_INDIRECT_F64: return WebAssembly::PCALL_INDIRECT_F64_S; + case WebAssembly::PCALL_INDIRECT_I32: return WebAssembly::PCALL_INDIRECT_I32_S; + case WebAssembly::PCALL_INDIRECT_I64: return WebAssembly::PCALL_INDIRECT_I64_S; + case WebAssembly::PCALL_INDIRECT_VOID: return WebAssembly::PCALL_INDIRECT_VOID_S; + case WebAssembly::PCALL_INDIRECT_v16i8: return WebAssembly::PCALL_INDIRECT_v16i8_S; + case WebAssembly::PCALL_INDIRECT_v4f32: return WebAssembly::PCALL_INDIRECT_v4f32_S; + case WebAssembly::PCALL_INDIRECT_v4i32: return WebAssembly::PCALL_INDIRECT_v4i32_S; + case WebAssembly::PCALL_INDIRECT_v8i16: return WebAssembly::PCALL_INDIRECT_v8i16_S; + case WebAssembly::POPCNT_I32: return WebAssembly::POPCNT_I32_S; + case WebAssembly::POPCNT_I64: return WebAssembly::POPCNT_I64_S; + case WebAssembly::REM_S_I32: return WebAssembly::REM_S_I32_S; + case WebAssembly::REM_S_I64: return WebAssembly::REM_S_I64_S; + case WebAssembly::REM_U_I32: return WebAssembly::REM_U_I32_S; + case WebAssembly::REM_U_I64: return WebAssembly::REM_U_I64_S; + case WebAssembly::RETHROW: return WebAssembly::RETHROW_S; + case WebAssembly::RETHROW_TO_CALLER: return WebAssembly::RETHROW_TO_CALLER_S; + case WebAssembly::RETURN_EXCEPT_REF: return WebAssembly::RETURN_EXCEPT_REF_S; + case WebAssembly::RETURN_F32: return WebAssembly::RETURN_F32_S; + case WebAssembly::RETURN_F64: return WebAssembly::RETURN_F64_S; + case WebAssembly::RETURN_I32: return WebAssembly::RETURN_I32_S; + case WebAssembly::RETURN_I64: return WebAssembly::RETURN_I64_S; + case WebAssembly::RETURN_VOID: return WebAssembly::RETURN_VOID_S; + case WebAssembly::RETURN_v16i8: return WebAssembly::RETURN_v16i8_S; + case WebAssembly::RETURN_v4f32: return WebAssembly::RETURN_v4f32_S; + case WebAssembly::RETURN_v4i32: return WebAssembly::RETURN_v4i32_S; + case WebAssembly::RETURN_v8i16: return WebAssembly::RETURN_v8i16_S; + case WebAssembly::ROTL_I32: return WebAssembly::ROTL_I32_S; + case WebAssembly::ROTL_I64: return WebAssembly::ROTL_I64_S; + case WebAssembly::ROTR_I32: return WebAssembly::ROTR_I32_S; + case WebAssembly::ROTR_I64: return WebAssembly::ROTR_I64_S; + case WebAssembly::SELECT_EXCEPT_REF: return WebAssembly::SELECT_EXCEPT_REF_S; + case WebAssembly::SELECT_F32: return WebAssembly::SELECT_F32_S; + case WebAssembly::SELECT_F64: return WebAssembly::SELECT_F64_S; + case WebAssembly::SELECT_I32: return WebAssembly::SELECT_I32_S; + case WebAssembly::SELECT_I64: return WebAssembly::SELECT_I64_S; + case WebAssembly::SET_GLOBAL_EXCEPT_REF: return WebAssembly::SET_GLOBAL_EXCEPT_REF_S; + case WebAssembly::SET_GLOBAL_F32: return WebAssembly::SET_GLOBAL_F32_S; + case WebAssembly::SET_GLOBAL_F64: return WebAssembly::SET_GLOBAL_F64_S; + case WebAssembly::SET_GLOBAL_I32: return WebAssembly::SET_GLOBAL_I32_S; + case WebAssembly::SET_GLOBAL_I64: return WebAssembly::SET_GLOBAL_I64_S; + case WebAssembly::SET_GLOBAL_V128: return WebAssembly::SET_GLOBAL_V128_S; + case WebAssembly::SET_LOCAL_EXCEPT_REF: return WebAssembly::SET_LOCAL_EXCEPT_REF_S; + case WebAssembly::SET_LOCAL_F32: return WebAssembly::SET_LOCAL_F32_S; + case WebAssembly::SET_LOCAL_F64: return WebAssembly::SET_LOCAL_F64_S; + case WebAssembly::SET_LOCAL_I32: return WebAssembly::SET_LOCAL_I32_S; + case WebAssembly::SET_LOCAL_I64: return WebAssembly::SET_LOCAL_I64_S; + case WebAssembly::SET_LOCAL_V128: return WebAssembly::SET_LOCAL_V128_S; + case WebAssembly::SHL_I32: return WebAssembly::SHL_I32_S; + case WebAssembly::SHL_I64: return WebAssembly::SHL_I64_S; + case WebAssembly::SHR_S_I32: return WebAssembly::SHR_S_I32_S; + case WebAssembly::SHR_S_I64: return WebAssembly::SHR_S_I64_S; + case WebAssembly::SHR_U_I32: return WebAssembly::SHR_U_I32_S; + case WebAssembly::SHR_U_I64: return WebAssembly::SHR_U_I64_S; + case WebAssembly::SQRT_F32: return WebAssembly::SQRT_F32_S; + case WebAssembly::SQRT_F64: return WebAssembly::SQRT_F64_S; + case WebAssembly::STORE16_I32: return WebAssembly::STORE16_I32_S; + case WebAssembly::STORE16_I64: return WebAssembly::STORE16_I64_S; + case WebAssembly::STORE32_I64: return WebAssembly::STORE32_I64_S; + case WebAssembly::STORE8_I32: return WebAssembly::STORE8_I32_S; + case WebAssembly::STORE8_I64: return WebAssembly::STORE8_I64_S; + case WebAssembly::STORE_F32: return WebAssembly::STORE_F32_S; + case WebAssembly::STORE_F64: return WebAssembly::STORE_F64_S; + case WebAssembly::STORE_I32: return WebAssembly::STORE_I32_S; + case WebAssembly::STORE_I64: return WebAssembly::STORE_I64_S; + case WebAssembly::SUB_F32: return WebAssembly::SUB_F32_S; + case WebAssembly::SUB_F32x4: return WebAssembly::SUB_F32x4_S; + case WebAssembly::SUB_F64: return WebAssembly::SUB_F64_S; + case WebAssembly::SUB_I16x8: return WebAssembly::SUB_I16x8_S; + case WebAssembly::SUB_I32: return WebAssembly::SUB_I32_S; + case WebAssembly::SUB_I32x4: return WebAssembly::SUB_I32x4_S; + case WebAssembly::SUB_I64: return WebAssembly::SUB_I64_S; + case WebAssembly::SUB_I8x16: return WebAssembly::SUB_I8x16_S; + case WebAssembly::TEE_EXCEPT_REF: return WebAssembly::TEE_EXCEPT_REF_S; + case WebAssembly::TEE_F32: return WebAssembly::TEE_F32_S; + case WebAssembly::TEE_F64: return WebAssembly::TEE_F64_S; + case WebAssembly::TEE_I32: return WebAssembly::TEE_I32_S; + case WebAssembly::TEE_I64: return WebAssembly::TEE_I64_S; + case WebAssembly::TEE_LOCAL_EXCEPT_REF: return WebAssembly::TEE_LOCAL_EXCEPT_REF_S; + case WebAssembly::TEE_LOCAL_F32: return WebAssembly::TEE_LOCAL_F32_S; + case WebAssembly::TEE_LOCAL_F64: return WebAssembly::TEE_LOCAL_F64_S; + case WebAssembly::TEE_LOCAL_I32: return WebAssembly::TEE_LOCAL_I32_S; + case WebAssembly::TEE_LOCAL_I64: return WebAssembly::TEE_LOCAL_I64_S; + case WebAssembly::TEE_LOCAL_V128: return WebAssembly::TEE_LOCAL_V128_S; + case WebAssembly::TEE_V128: return WebAssembly::TEE_V128_S; + case WebAssembly::THROW_I32: return WebAssembly::THROW_I32_S; + case WebAssembly::THROW_I64: return WebAssembly::THROW_I64_S; + case WebAssembly::TRUNC_F32: return WebAssembly::TRUNC_F32_S; + case WebAssembly::TRUNC_F64: return WebAssembly::TRUNC_F64_S; + case WebAssembly::TRY: return WebAssembly::TRY_S; + case WebAssembly::UNREACHABLE: return WebAssembly::UNREACHABLE_S; + case WebAssembly::XOR_I32: return WebAssembly::XOR_I32_S; + case WebAssembly::XOR_I64: return WebAssembly::XOR_I64_S; + } +} Index: lib/Target/WebAssembly/WebAssemblyInstrMemory.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrMemory.td +++ lib/Target/WebAssembly/WebAssemblyInstrMemory.td @@ -57,11 +57,12 @@ // Defines atomic and non-atomic loads, regular and extending. multiclass WebAssemblyLoad { + let mayLoad = 1 in defm "": I<(outs rc:$dst), (ins P2Align:$p2align, offset32_op:$off, I32:$addr), (outs), (ins P2Align:$p2align, offset32_op:$off), [], !strconcat(Name, "\t$dst, ${off}(${addr})${p2align}"), - !strconcat(Name, "\t${off}, ${p2align}"), Opcode>; + !strconcat(Name, "\t${off}${p2align}"), Opcode>; } // Basic load. @@ -308,12 +309,13 @@ // Defines atomic and non-atomic stores, regular and truncating multiclass WebAssemblyStore { + let mayStore = 1 in defm "" : I<(outs), (ins P2Align:$p2align, offset32_op:$off, I32:$addr, rc:$val), (outs), (ins P2Align:$p2align, offset32_op:$off), [], !strconcat(Name, "\t${off}(${addr})${p2align}, $val"), - !strconcat(Name, "\t${off}, ${p2align}"), Opcode>; + !strconcat(Name, "\t${off}${p2align}"), Opcode>; } // Basic store. // Note: WebAssembly inverts SelectionDAG's usual operand order. @@ -473,12 +475,12 @@ // Grow memory. defm MEMORY_GROW_I32 : I<(outs I32:$dst), (ins i32imm:$flags, I32:$delta), - (outs), (ins i32imm:$flags, I32:$delta), + (outs), (ins i32imm:$flags), [(set I32:$dst, (int_wasm_memory_grow (i32 imm:$flags), I32:$delta))], "memory.grow\t$dst, $flags, $delta", - "memory.grow\t$flags, $delta", 0x3f>, + "memory.grow\t$flags", 0x3f>, Requires<[HasAddr32]>; defm MEM_GROW_I32 : I<(outs I32:$dst), (ins i32imm:$flags, I32:$delta), (outs), (ins i32imm:$flags), Index: lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp =================================================================== --- lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp +++ lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp @@ -319,9 +319,6 @@ // converted into a local. addPass(createWebAssemblyFixIrreducibleControlFlow()); - // Insert explicit get_local and set_local operators. - addPass(createWebAssemblyExplicitLocals()); - // Do various transformations for exception handling addPass(createWebAssemblyLateEHPrepare()); @@ -339,6 +336,9 @@ if (getOptLevel() != CodeGenOpt::None) addPass(createWebAssemblyPeephole()); + // Insert explicit get_local and set_local operators. + addPass(createWebAssemblyExplicitLocals()); + // Create a mapping from LLVM CodeGen virtual registers to wasm registers. addPass(createWebAssemblyRegNumbering()); } Index: test/CodeGen/WebAssembly/address-offsets.ll =================================================================== --- test/CodeGen/WebAssembly/address-offsets.ll +++ test/CodeGen/WebAssembly/address-offsets.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test folding constant offsets and symbols into load and store addresses under ; a variety of circumstances. @@ -10,9 +10,9 @@ ; CHECK-LABEL: load_test0: ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.load $push1=, g+40($pop0){{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.load g+40{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test0() { %t = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 10), align 4 ret i32 %t @@ -20,9 +20,9 @@ ; CHECK-LABEL: load_test0_noinbounds: ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.load $push1=, g+40($pop0){{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.load g+40{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test0_noinbounds() { %t = load i32, i32* getelementptr ([0 x i32], [0 x i32]* @g, i32 0, i32 10), align 4 ret i32 %t @@ -35,10 +35,10 @@ ; CHECK-LABEL: load_test1: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test1(i32 %n) { %add = add nsw i32 %n, 10 %arrayidx = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %add @@ -49,10 +49,10 @@ ; CHECK-LABEL: load_test2: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test2(i32 %n) { %add = add nsw i32 10, %n %arrayidx = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %add @@ -63,10 +63,10 @@ ; CHECK-LABEL: load_test3: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test3(i32 %n) { %add.ptr = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %n %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 10 @@ -77,10 +77,10 @@ ; CHECK-LABEL: load_test4: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test4(i32 %n) { %add.ptr = getelementptr inbounds i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 10), i32 %n %t = load i32, i32* %add.ptr, align 4 @@ -90,10 +90,10 @@ ; CHECK-LABEL: load_test5: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test5(i32 %n) { %add.ptr = getelementptr inbounds i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 10), i32 %n %t = load i32, i32* %add.ptr, align 4 @@ -103,10 +103,10 @@ ; CHECK-LABEL: load_test6: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test6(i32 %n) { %add = add nsw i32 %n, 10 %add.ptr = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %add @@ -117,10 +117,10 @@ ; CHECK-LABEL: load_test7: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test7(i32 %n) { %add.ptr = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %n %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 10 @@ -131,10 +131,10 @@ ; CHECK-LABEL: load_test8: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEX T: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.load $push2=, g+40($pop1){{$}} -; CHECK-NEX T: return $pop2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEX T: i32.shl +; CHECK-NEX T: i32.load g+40{{$}} +; CHECK-NEX T: return {{$}} define i32 @load_test8(i32 %n) { %add = add nsw i32 10, %n %add.ptr = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %add @@ -144,9 +144,9 @@ ; CHECK-LABEL: load_test9: ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.load $push1=, g-40($pop0){{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.load g-40{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test9() { %t = load i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 1073741814), align 4 ret i32 %t @@ -155,12 +155,12 @@ ; CHECK-LABEL: load_test10: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEXT: i32.const $push2=, g-40{{$}} -; CHECK-NEXT: i32.add $push3=, $pop1, $pop2{{$}} -; CHECK-NEXT: i32.load $push4=, 0($pop3){{$}} -; CHECK-NEXT: return $pop4{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.const g-40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test10(i32 %n) { %add = add nsw i32 %n, -10 %arrayidx = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %add @@ -171,8 +171,8 @@ ; CHECK-LABEL: load_test11: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.load $push0=, 40($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.load 40{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test11(i32* %p) { %arrayidx = getelementptr inbounds i32, i32* %p, i32 10 %t = load i32, i32* %arrayidx, align 4 @@ -182,10 +182,10 @@ ; CHECK-LABEL: load_test11_noinbounds: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 40{{$}} -; CHECK-NEXT: i32.add $push1=, $0, $pop0{{$}} -; CHECK-NEXT: i32.load $push2=, 0($pop1){{$}} -; CHECK-NEXT: return $pop2{{$}} +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test11_noinbounds(i32* %p) { %arrayidx = getelementptr i32, i32* %p, i32 10 %t = load i32, i32* %arrayidx, align 4 @@ -195,13 +195,13 @@ ; CHECK-LABEL: load_test12: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.load $push5=, 0($pop4){{$}} -; CHECK-NEXT: return $pop5{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test12(i32* %p, i32 %n) { %add = add nsw i32 %n, 10 %arrayidx = getelementptr inbounds i32, i32* %p, i32 %add @@ -212,13 +212,13 @@ ; CHECK-LABEL: load_test13: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.load $push5=, 0($pop4){{$}} -; CHECK-NEXT: return $pop5{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test13(i32* %p, i32 %n) { %add = add nsw i32 10, %n %arrayidx = getelementptr inbounds i32, i32* %p, i32 %add @@ -229,11 +229,11 @@ ; CHECK-LABEL: load_test14: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.load $push3=, 40($pop2){{$}} -; CHECK-NEXT: return $pop3{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.load 40{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test14(i32* %p, i32 %n) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 %n %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 10 @@ -244,13 +244,13 @@ ; CHECK-LABEL: load_test15: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.load $push5=, 0($pop4){{$}} -; CHECK-NEXT: return $pop5{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test15(i32* %p, i32 %n) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 10 %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 %n @@ -261,13 +261,13 @@ ; CHECK-LABEL: load_test16: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.load $push5=, 0($pop4){{$}} -; CHECK-NEXT: return $pop5{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test16(i32* %p, i32 %n) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 10 %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 %n @@ -278,13 +278,13 @@ ; CHECK-LABEL: load_test17: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.load $push5=, 0($pop4){{$}} -; CHECK-NEXT: return $pop5{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test17(i32* %p, i32 %n) { %add = add nsw i32 %n, 10 %add.ptr = getelementptr inbounds i32, i32* %p, i32 %add @@ -295,11 +295,11 @@ ; CHECK-LABEL: load_test18: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.load $push3=, 40($pop2){{$}} -; CHECK-NEXT: return $pop3{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.load 40{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test18(i32* %p, i32 %n) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 %n %add.ptr1 = getelementptr inbounds i32, i32* %add.ptr, i32 10 @@ -310,13 +310,13 @@ ; CHECK-LABEL: load_test19: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.load $push5=, 0($pop4){{$}} -; CHECK-NEXT: return $pop5{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test19(i32* %p, i32 %n) { %add = add nsw i32 10, %n %add.ptr = getelementptr inbounds i32, i32* %p, i32 %add @@ -327,10 +327,10 @@ ; CHECK-LABEL: load_test20: ; CHECK-NEXT: param i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, -40{{$}} -; CHECK-NEXT: i32.add $push1=, $0, $pop0{{$}} -; CHECK-NEXT: i32.load $push2=, 0($pop1){{$}} -; CHECK-NEXT: return $pop2{{$}} +; CHECK-NEXT: i32.const -40{{$}} +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test20(i32* %p) { %arrayidx = getelementptr inbounds i32, i32* %p, i32 -10 %t = load i32, i32* %arrayidx, align 4 @@ -340,13 +340,13 @@ ; CHECK-LABEL: load_test21: ; CHECK-NEXT: param i32, i32{{$}} ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, -40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.load $push5=, 0($pop4){{$}} -; CHECK-NEXT: return $pop5{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const -40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return {{$}} define i32 @load_test21(i32* %p, i32 %n) { %add = add nsw i32 %n, -10 %arrayidx = getelementptr inbounds i32, i32* %p, i32 %add @@ -356,8 +356,8 @@ ; CHECK-LABEL: store_test0: ; CHECK-NEXT: param i32{{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.store g+40($pop0), $0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.store g+40{{$}} ; CHECK-NEXT: return{{$}} define void @store_test0(i32 %i) { store i32 %i, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 10), align 4 @@ -366,8 +366,8 @@ ; CHECK-LABEL: store_test0_noinbounds: ; CHECK-NEXT: param i32{{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.store g+40($pop0), $0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.store g+40{{$}} ; CHECK-NEXT: return{{$}} define void @store_test0_noinbounds(i32 %i) { store i32 %i, i32* getelementptr ([0 x i32], [0 x i32]* @g, i32 0, i32 10), align 4 @@ -376,9 +376,9 @@ ; CHECK-LABEL: store_test1: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test1(i32 %n, i32 %i) { %add = add nsw i32 %n, 10 @@ -389,9 +389,9 @@ ; CHECK-LABEL: store_test2: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test2(i32 %n, i32 %i) { %add = add nsw i32 10, %n @@ -402,9 +402,9 @@ ; CHECK-LABEL: store_test3: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test3(i32 %n, i32 %i) { %add.ptr = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %n @@ -415,9 +415,9 @@ ; CHECK-LABEL: store_test4: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test4(i32 %n, i32 %i) { %add.ptr = getelementptr inbounds i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 10), i32 %n @@ -427,9 +427,9 @@ ; CHECK-LABEL: store_test5: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test5(i32 %n, i32 %i) { %add.ptr = getelementptr inbounds i32, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 10), i32 %n @@ -439,9 +439,9 @@ ; CHECK-LABEL: store_test6: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test6(i32 %n, i32 %i) { %add = add nsw i32 %n, 10 @@ -452,9 +452,9 @@ ; CHECK-LABEL: store_test7: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test7(i32 %n, i32 %i) { %add.ptr = getelementptr inbounds [0 x i32], [0 x i32]* @g, i32 0, i32 %n @@ -465,9 +465,9 @@ ; CHECK-LABEL: store_test8: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEX T: i32.store g+40($pop1), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEX T: i32.store g+40{{$}} ; CHECK-NEX T: return{{$}} define void @store_test8(i32 %n, i32 %i) { %add = add nsw i32 10, %n @@ -478,8 +478,8 @@ ; CHECK-LABEL: store_test9: ; CHECK-NEXT: param i32{{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.store g-40($pop0), $0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.store g-40{{$}} ; CHECK-NEXT: return{{$}} define void @store_test9(i32 %i) { store i32 %i, i32* getelementptr inbounds ([0 x i32], [0 x i32]* @g, i32 0, i32 1073741814), align 4 @@ -488,11 +488,11 @@ ; CHECK-LABEL: store_test10: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $0, $pop0{{$}} -; CHECK-NEXT: i32.const $push2=, g-40{{$}} -; CHECK-NEXT: i32.add $push3=, $pop1, $pop2{{$}} -; CHECK-NEXT: i32.store 0($pop3), $1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.const g-40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test10(i32 %n, i32 %i) { %add = add nsw i32 %n, -10 @@ -503,7 +503,7 @@ ; CHECK-LABEL: store_test11: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.store 40($0), $1{{$}} +; CHECK-NEXT: i32.store 40{{$}} ; CHECK-NEXT: return{{$}} define void @store_test11(i32* %p, i32 %i) { %arrayidx = getelementptr inbounds i32, i32* %p, i32 10 @@ -513,9 +513,9 @@ ; CHECK-LABEL: store_test11_noinbounds: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 40{{$}} -; CHECK-NEXT: i32.add $push1=, $0, $pop0{{$}} -; CHECK-NEXT: i32.store 0($pop1), $1{{$}} +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test11_noinbounds(i32* %p, i32 %i) { %arrayidx = getelementptr i32, i32* %p, i32 10 @@ -525,12 +525,12 @@ ; CHECK-LABEL: store_test12: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.store 0($pop4), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test12(i32* %p, i32 %n, i32 %i) { %add = add nsw i32 %n, 10 @@ -541,12 +541,12 @@ ; CHECK-LABEL: store_test13: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.store 0($pop4), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test13(i32* %p, i32 %n, i32 %i) { %add = add nsw i32 10, %n @@ -557,10 +557,10 @@ ; CHECK-LABEL: store_test14: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.store 40($pop2), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.store 40{{$}} ; CHECK-NEXT: return{{$}} define void @store_test14(i32* %p, i32 %n, i32 %i) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 %n @@ -571,12 +571,12 @@ ; CHECK-LABEL: store_test15: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.store 0($pop4), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test15(i32* %p, i32 %n, i32 %i) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 10 @@ -587,12 +587,12 @@ ; CHECK-LABEL: store_test16: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.store 0($pop4), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test16(i32* %p, i32 %n, i32 %i) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 10 @@ -603,12 +603,12 @@ ; CHECK-LABEL: store_test17: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.store 0($pop4), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test17(i32* %p, i32 %n, i32 %i) { %add = add nsw i32 %n, 10 @@ -619,10 +619,10 @@ ; CHECK-LABEL: store_test18: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.store 40($pop2), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.store 40{{$}} ; CHECK-NEXT: return{{$}} define void @store_test18(i32* %p, i32 %n, i32 %i) { %add.ptr = getelementptr inbounds i32, i32* %p, i32 %n @@ -633,12 +633,12 @@ ; CHECK-LABEL: store_test19: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, 40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.store 0($pop4), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const 40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test19(i32* %p, i32 %n, i32 %i) { %add = add nsw i32 10, %n @@ -649,9 +649,9 @@ ; CHECK-LABEL: store_test20: ; CHECK-NEXT: param i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, -40{{$}} -; CHECK-NEXT: i32.add $push1=, $0, $pop0{{$}} -; CHECK-NEXT: i32.store 0($pop1), $1{{$}} +; CHECK-NEXT: i32.const -40{{$}} +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test20(i32* %p, i32 %i) { %arrayidx = getelementptr inbounds i32, i32* %p, i32 -10 @@ -661,12 +661,12 @@ ; CHECK-LABEL: store_test21: ; CHECK-NEXT: param i32, i32, i32{{$}} -; CHECK-NEXT: i32.const $push0=, 2{{$}} -; CHECK-NEXT: i32.shl $push1=, $1, $pop0{{$}} -; CHECK-NEXT: i32.add $push2=, $0, $pop1{{$}} -; CHECK-NEXT: i32.const $push3=, -40{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: i32.store 0($pop4), $2{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.const -40{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_test21(i32* %p, i32 %n, i32 %i) { %add = add nsw i32 %n, -10 Index: test/CodeGen/WebAssembly/byval.ll =================================================================== --- test/CodeGen/WebAssembly/byval.ll +++ test/CodeGen/WebAssembly/byval.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -verify-machineinstrs | FileCheck %s -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -verify-machineinstrs -fast-isel | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -verify-machineinstrs | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -verify-machineinstrs -fast-isel | FileCheck %s target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" @@ -24,24 +24,24 @@ define void @byval_arg(%SmallStruct* %ptr) { ; CHECK: .param i32 ; Subtract 16 from SP (SP is 16-byte aligned) - ; CHECK-NEXT: get_global $push[[L2:.+]]=, __stack_pointer - ; CHECK-NEXT: i32.const $push[[L3:.+]]=, 16 - ; CHECK-NEXT: i32.sub $push[[L11:.+]]=, $pop[[L2]], $pop[[L3]] + ; CHECK-NEXT: get_global __stack_pointer + ; CHECK-NEXT: i32.const 16 + ; CHECK-NEXT: i32.sub ; Ensure SP is stored back before the call - ; CHECK-NEXT: tee_local $push[[L10:.+]]=, $[[SP:.+]]=, $pop[[L11]]{{$}} - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L10]]{{$}} + ; CHECK-NEXT: tee_local $[[SP:.+]]={{$}} + ; CHECK-NEXT: set_global __stack_pointer{{$}} ; Copy the SmallStruct argument to the stack (SP+12, original SP-4) - ; CHECK-NEXT: i32.load $push[[L0:.+]]=, 0($0) - ; CHECK-NEXT: i32.store 12($[[SP]]), $pop[[L0]] + ; CHECK-NEXT: i32.load 0 + ; CHECK-NEXT: i32.store 12($[[SP]]) ; Pass a pointer to the stack slot to the function - ; CHECK-NEXT: i32.const $push[[L5:.+]]=, 12{{$}} - ; CHECK-NEXT: i32.add $push[[ARG:.+]]=, $[[SP]], $pop[[L5]]{{$}} - ; CHECK-NEXT: call ext_byval_func@FUNCTION, $pop[[ARG]]{{$}} + ; CHECK-NEXT: i32.const 12{{$}} + ; CHECK-NEXT: i32.add $[[SP]]{{$}} + ; CHECK-NEXT: call ext_byval_func@FUNCTION{{$}} call void @ext_byval_func(%SmallStruct* byval %ptr) ; Restore the stack - ; CHECK-NEXT: i32.const $push[[L6:.+]]=, 16 - ; CHECK-NEXT: i32.add $push[[L8:.+]]=, $[[SP]], $pop[[L6]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L8]] + ; CHECK-NEXT: i32.const 16 + ; CHECK-NEXT: i32.add $[[SP]] + ; CHECK-NEXT: set_global __stack_pointer ; CHECK-NEXT: return ret void } @@ -50,17 +50,17 @@ define void @byval_arg_align8(%SmallStruct* %ptr) { ; CHECK: .param i32 ; Don't check the entire SP sequence, just enough to get the alignment. - ; CHECK: i32.const $push[[L1:.+]]=, 16 - ; CHECK-NEXT: i32.sub $push[[L11:.+]]=, {{.+}}, $pop[[L1]] - ; CHECK-NEXT: tee_local $push[[L10:.+]]=, $[[SP:.+]]=, $pop[[L11]]{{$}} - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L10]]{{$}} + ; CHECK: i32.const 16 + ; CHECK-NEXT: i32.sub {{.+}} + ; CHECK-NEXT: tee_local $[[SP:.+]]={{$}} + ; CHECK-NEXT: set_global __stack_pointer{{$}} ; Copy the SmallStruct argument to the stack (SP+8, original SP-8) - ; CHECK-NEXT: i32.load $push[[L0:.+]]=, 0($0){{$}} - ; CHECK-NEXT: i32.store 8($[[SP]]), $pop[[L0]]{{$}} + ; CHECK-NEXT: i32.load 0{{$}} + ; CHECK-NEXT: i32.store 8($[[SP]]){{$}} ; Pass a pointer to the stack slot to the function - ; CHECK-NEXT: i32.const $push[[L5:.+]]=, 8{{$}} - ; CHECK-NEXT: i32.add $push[[ARG:.+]]=, $[[SP]], $pop[[L5]]{{$}} - ; CHECK-NEXT: call ext_byval_func_align8@FUNCTION, $pop[[ARG]]{{$}} + ; CHECK-NEXT: i32.const 8{{$}} + ; CHECK-NEXT: i32.add $[[SP]]{{$}} + ; CHECK-NEXT: call ext_byval_func_align8@FUNCTION{{$}} call void @ext_byval_func_align8(%SmallStruct* byval align 8 %ptr) ret void } @@ -69,14 +69,14 @@ define void @byval_arg_double(%AlignedStruct* %ptr) { ; CHECK: .param i32 ; Subtract 16 from SP (SP is 16-byte aligned) - ; CHECK: i32.const $push[[L1:.+]]=, 16 - ; CHECK-NEXT: i32.sub $push[[L14:.+]]=, {{.+}}, $pop[[L1]] - ; CHECK-NEXT: tee_local $push[[L13:.+]]=, $[[SP:.+]]=, $pop[[L14]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L13]] + ; CHECK: i32.const 16 + ; CHECK-NEXT: i32.sub {{.+}} + ; CHECK-NEXT: tee_local $[[SP:.+]]= + ; CHECK-NEXT: set_global __stack_pointer ; Copy the AlignedStruct argument to the stack (SP+0, original SP-16) ; Just check the last load/store pair of the memcpy - ; CHECK: i64.load $push[[L4:.+]]=, 0($0) - ; CHECK-NEXT: i64.store 0($[[SP]]), $pop[[L4]] + ; CHECK: i64.load 0 + ; CHECK-NEXT: i64.store 0($[[SP]]) ; Pass a pointer to the stack slot to the function ; CHECK-NEXT: call ext_byval_func_alignedstruct@FUNCTION, $[[SP]] tail call void @ext_byval_func_alignedstruct(%AlignedStruct* byval %ptr) @@ -87,7 +87,7 @@ define void @byval_param(%SmallStruct* byval align 32 %ptr) { ; CHECK: .param i32 ; %ptr is just a pointer to a struct, so pass it directly through - ; CHECK: call ext_func@FUNCTION, $0 + ; CHECK: call ext_func@FUNCTION call void @ext_func(%SmallStruct* %ptr) ret void } @@ -95,7 +95,7 @@ ; CHECK-LABEL: byval_empty_caller define void @byval_empty_caller(%EmptyStruct* %ptr) { ; CHECK: .param i32 - ; CHECK: call ext_byval_func_empty@FUNCTION, $0 + ; CHECK: call ext_byval_func_empty@FUNCTION call void @ext_byval_func_empty(%EmptyStruct* byval %ptr) ret void } @@ -103,21 +103,21 @@ ; CHECK-LABEL: byval_empty_callee define void @byval_empty_callee(%EmptyStruct* byval %ptr) { ; CHECK: .param i32 - ; CHECK: call ext_func_empty@FUNCTION, $0 + ; CHECK: call ext_func_empty@FUNCTION call void @ext_func_empty(%EmptyStruct* %ptr) ret void } ; Call memcpy for "big" byvals. ; CHECK-LABEL: big_byval: -; CHECK: get_global $push[[L2:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: i32.const $push[[L3:.+]]=, 131072 -; CHECK-NEXT: i32.sub $push[[L11:.+]]=, $pop[[L2]], $pop[[L3]] -; CHECK-NEXT: tee_local $push[[L10:.+]]=, $[[SP:.+]]=, $pop[[L11]]{{$}} -; CHECK-NEXT: set_global __stack_pointer, $pop[[L10]]{{$}} -; CHECK-NEXT: i32.const $push[[L0:.+]]=, 131072 -; CHECK-NEXT: i32.call $push[[L11:.+]]=, memcpy@FUNCTION, $[[SP]], ${{.+}}, $pop{{.+}} -; CHECK-NEXT: tee_local $push[[L9:.+]]=, $[[SP:.+]]=, $pop[[L11]]{{$}} +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: i32.const 131072 +; CHECK-NEXT: i32.sub +; CHECK-NEXT: tee_local $[[SP:.+]]={{$}} +; CHECK-NEXT: set_global __stack_pointer{{$}} +; CHECK-NEXT: i32.const 131072 +; CHECK-NEXT: i32.call memcpy@FUNCTION, $[[SP]], ${{.+}} +; CHECK-NEXT: tee_local $[[SP:.+]]={{$}} ; CHECK-NEXT: call big_byval_callee@FUNCTION, %big = type [131072 x i8] declare void @big_byval_callee(%big* byval align 1) Index: test/CodeGen/WebAssembly/call.ll =================================================================== --- test/CodeGen/WebAssembly/call.ll +++ test/CodeGen/WebAssembly/call.ll @@ -16,8 +16,8 @@ ; CHECK-LABEL: call_i32_nullary: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: {{^}} i32.call $push[[NUM:[0-9]+]]=, i32_nullary@FUNCTION{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: {{^}} i32.call i32_nullary@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define i32 @call_i32_nullary() { %r = call i32 @i32_nullary() ret i32 %r @@ -25,8 +25,8 @@ ; CHECK-LABEL: call_i64_nullary: ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: {{^}} i64.call $push[[NUM:[0-9]+]]=, i64_nullary@FUNCTION{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: {{^}} i64.call i64_nullary@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define i64 @call_i64_nullary() { %r = call i64 @i64_nullary() ret i64 %r @@ -34,8 +34,8 @@ ; CHECK-LABEL: call_float_nullary: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: {{^}} f32.call $push[[NUM:[0-9]+]]=, float_nullary@FUNCTION{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: {{^}} f32.call float_nullary@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define float @call_float_nullary() { %r = call float @float_nullary() ret float %r @@ -43,8 +43,8 @@ ; CHECK-LABEL: call_double_nullary: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: {{^}} f64.call $push[[NUM:[0-9]+]]=, double_nullary@FUNCTION{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: {{^}} f64.call double_nullary@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define double @call_double_nullary() { %r = call double @double_nullary() ret double %r @@ -61,9 +61,9 @@ ; CHECK-LABEL: call_i32_unary: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: {{^}} i32.call $push[[NUM:[0-9]+]]=, i32_unary@FUNCTION, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: {{^}} i32.call i32_unary@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define i32 @call_i32_unary(i32 %a) { %r = call i32 @i32_unary(i32 %a) ret i32 %r @@ -72,10 +72,10 @@ ; CHECK-LABEL: call_i32_binary: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: {{^}} i32.call $push[[NUM:[0-9]+]]=, i32_binary@FUNCTION, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: {{^}} i32.call i32_binary@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define i32 @call_i32_binary(i32 %a, i32 %b) { %r = call i32 @i32_binary(i32 %a, i32 %b) ret i32 %r @@ -83,8 +83,8 @@ ; CHECK-LABEL: call_indirect_void: ; CHECK-NEXT: .param i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: {{^}} call_indirect $pop[[L0]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: {{^}} call_indirect{{$}} ; CHECK-NEXT: return{{$}} define void @call_indirect_void(void ()* %callee) { call void %callee() @@ -94,9 +94,9 @@ ; CHECK-LABEL: call_indirect_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: {{^}} i32.call_indirect $push[[NUM:[0-9]+]]=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: {{^}} i32.call_indirect{{$}} +; CHECK-NEXT: return{{$}} define i32 @call_indirect_i32(i32 ()* %callee) { %t = call i32 %callee() ret i32 %t @@ -104,9 +104,9 @@ ; CHECK-LABEL: call_indirect_arg: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: {{^}} call_indirect $pop[[L0]], $pop[[L1]]{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: {{^}} call_indirect{{$}} ; CHECK-NEXT: return{{$}} define void @call_indirect_arg(void (i32)* %callee, i32 %arg) { call void %callee(i32 %arg) @@ -115,11 +115,11 @@ ; CHECK-LABEL: call_indirect_arg_2: ; CHECK-NEXT: .param i32, i32, i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 2{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: {{^}} i32.call_indirect $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]], $pop[[L2]]{{$}} -; CHECK-NEXT: drop $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 2{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: {{^}} i32.call_indirect{{$}} +; CHECK-NEXT: drop{{$}} ; CHECK-NEXT: return{{$}} define void @call_indirect_arg_2(i32 (i32, i32)* %callee, i32 %arg, i32 %arg2) { call i32 %callee(i32 %arg, i32 %arg2) @@ -151,9 +151,9 @@ } ; CHECK-LABEL: call_constexpr: -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 2{{$}} -; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, 3{{$}} -; CHECK-NEXT: call .Lbitcast@FUNCTION, $pop[[L0]], $pop[[L1]]{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.const 3{{$}} +; CHECK-NEXT: call .Lbitcast@FUNCTION{{$}} ; CHECK-NEXT: call other_void_nullary@FUNCTION{{$}} ; CHECK-NEXT: call void_nullary@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} Index: test/CodeGen/WebAssembly/cfg-stackify.ll =================================================================== --- test/CodeGen/WebAssembly/cfg-stackify.ll +++ test/CodeGen/WebAssembly/cfg-stackify.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 | FileCheck %s -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -tail-dup-placement=0 -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 | FileCheck -check-prefix=OPT %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-block-placement -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -tail-dup-placement=0 -verify-machineinstrs -fast-isel=false -machine-sink-split-probability-threshold=0 -cgp-freq-ratio-to-skip-merge=1000 | FileCheck -check-prefix=OPT %s ; Test the CFG stackifier pass. @@ -105,22 +105,22 @@ ; CHECK-LABEL: test2: ; CHECK-NOT: local -; CHECK: block {{$}} +; CHECK: block {{$}} ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK: .LBB2_{{[0-9]+}}: ; CHECK: loop -; CHECK: br_if 0, $pop{{[0-9]+}}{{$}} +; CHECK: br_if 0{{$}} ; CHECK: .LBB2_{{[0-9]+}}: ; CHECK: end_loop ; CHECK: end_block ; CHECK: return{{$}} ; OPT-LABEL: test2: ; OPT-NOT: local -; OPT: block {{$}} +; OPT: block {{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT: .LBB2_{{[0-9]+}}: ; OPT: loop -; OPT: br_if 0, $pop{{[0-9]+}}{{$}} +; OPT: br_if 0{{$}} ; OPT: .LBB2_{{[0-9]+}}: ; OPT: end_loop ; OPT: end_block @@ -151,25 +151,25 @@ } ; CHECK-LABEL: doublediamond: -; CHECK: block {{$}} -; CHECK-NEXT: block {{$}} +; CHECK: block {{$}} +; CHECK-NEXT: block {{$}} ; CHECK: br_if 0, ${{[^,]+}}{{$}} ; CHECK: br 1{{$}} ; CHECK: .LBB3_2: ; CHECK-NEXT: end_block{{$}} -; CHECK: block {{$}} +; CHECK: block {{$}} ; CHECK: br_if 0, ${{[^,]+}}{{$}} ; CHECK: br 1{{$}} ; CHECK: .LBB3_4: ; CHECK-NEXT: end_block{{$}} ; CHECK: .LBB3_5: ; CHECK-NEXT: end_block{{$}} -; CHECK: i32.const $push{{[0-9]+}}=, 0{{$}} -; CHECK-NEXT: return $pop{{[0-9]+}}{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; OPT-LABEL: doublediamond: -; OPT: block {{$}} -; OPT-NEXT: block {{$}} -; OPT-NEXT: block {{$}} +; OPT: block {{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: block {{$}} ; OPT: br_if 0, ${{[^,]+}}{{$}} ; OPT: br_if 1, ${{[^,]+}}{{$}} ; OPT: br 2{{$}} @@ -179,7 +179,7 @@ ; OPT-NEXT: .LBB3_4: ; OPT: .LBB3_5: ; OPT-NEXT: end_block -; OPT: return $pop{{[0-9]+}}{{$}} +; OPT: return{{$}} define i32 @doublediamond(i32 %a, i32 %b, i32* %p) { entry: %c = icmp eq i32 %a, 0 @@ -204,13 +204,13 @@ } ; CHECK-LABEL: triangle: -; CHECK: block {{$}} -; CHECK: br_if 0, $1{{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} ; CHECK: .LBB4_2: ; CHECK: return ; OPT-LABEL: triangle: -; OPT: block {{$}} -; OPT: br_if 0, $1{{$}} +; OPT: block {{$}} +; OPT: br_if 0{{$}} ; OPT: .LBB4_2: ; OPT: return define i32 @triangle(i32* %p, i32 %a) { @@ -227,23 +227,23 @@ } ; CHECK-LABEL: diamond: -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: br_if 0, $1{{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} ; CHECK: br 1{{$}} ; CHECK: .LBB5_2: ; CHECK: .LBB5_3: -; CHECK: i32.const $push{{[0-9]+}}=, 0{{$}} -; CHECK-NEXT: return $pop{{[0-9]+}}{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; OPT-LABEL: diamond: -; OPT: block {{$}} -; OPT: block {{$}} +; OPT: block {{$}} +; OPT: block {{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT: br 1{{$}} ; OPT: .LBB5_2: ; OPT: .LBB5_3: -; OPT: i32.const $push{{[0-9]+}}=, 0{{$}} -; OPT-NEXT: return $pop{{[0-9]+}}{{$}} +; OPT: i32.const 0{{$}} +; OPT-NEXT: return{{$}} define i32 @diamond(i32* %p, i32 %a) { entry: %c = icmp eq i32 %a, 0 @@ -262,10 +262,10 @@ ; CHECK-LABEL: single_block: ; CHECK-NOT: br -; CHECK: return $pop{{[0-9]+}}{{$}} +; CHECK: return{{$}} ; OPT-LABEL: single_block: ; OPT-NOT: br -; OPT: return $pop{{[0-9]+}}{{$}} +; OPT: return{{$}} define i32 @single_block(i32* %p) { entry: store volatile i32 0, i32* %p @@ -276,14 +276,14 @@ ; CHECK-NOT: br ; CHECK: .LBB7_1: ; CHECK: loop i32 -; CHECK: i32.store 0($0), $pop{{[0-9]+}}{{$}} +; CHECK: i32.store 0{{$}} ; CHECK: br 0{{$}} ; CHECK: .LBB7_2: ; OPT-LABEL: minimal_loop: ; OPT-NOT: br ; OPT: .LBB7_1: ; OPT: loop i32 -; OPT: i32.store 0($0), $pop{{[0-9]+}}{{$}} +; OPT: i32.store 0{{$}} ; OPT: br 0{{$}} ; OPT: .LBB7_2: define i32 @minimal_loop(i32* %p) { @@ -298,19 +298,19 @@ ; CHECK-LABEL: simple_loop: ; CHECK-NOT: br ; CHECK: .LBB8_1: -; CHECK: loop {{$}} -; CHECK: br_if 0, $pop{{[0-9]+}}{{$}} +; CHECK: loop{{$}} +; CHECK: br_if 0{{$}} ; CHECK-NEXT: end_loop{{$}} -; CHECK: i32.const $push{{[0-9]+}}=, 0{{$}} -; CHECK-NEXT: return $pop{{[0-9]+}}{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; OPT-LABEL: simple_loop: ; OPT-NOT: br ; OPT: .LBB8_1: -; OPT: loop {{$}} +; OPT: loop{{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT-NEXT: end_loop{{$}} -; OPT: i32.const $push{{[0-9]+}}=, 0{{$}} -; OPT-NEXT: return $pop{{[0-9]+}}{{$}} +; OPT: i32.const 0{{$}} +; OPT-NEXT: return{{$}} define i32 @simple_loop(i32* %p, i32 %a) { entry: %c = icmp eq i32 %a, 0 @@ -325,18 +325,18 @@ } ; CHECK-LABEL: doubletriangle: -; CHECK: block {{$}} -; CHECK: br_if 0, $0{{$}} -; CHECK: block {{$}} -; CHECK: br_if 0, $1{{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} ; CHECK: .LBB9_3: ; CHECK: .LBB9_4: ; CHECK: return ; OPT-LABEL: doubletriangle: -; OPT: block {{$}} -; OPT: br_if 0, $0{{$}} -; OPT: block {{$}} -; OPT: br_if 0, $1{{$}} +; OPT: block {{$}} +; OPT: br_if 0{{$}} +; OPT: block {{$}} +; OPT: br_if 0{{$}} ; OPT: .LBB9_3: ; OPT: .LBB9_4: ; OPT: return @@ -361,25 +361,25 @@ } ; CHECK-LABEL: ifelse_earlyexits: -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: br_if 0, $0{{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} ; CHECK: br 1{{$}} ; CHECK: .LBB10_2: -; CHECK: br_if 0, $1{{$}} +; CHECK: br_if 0{{$}} ; CHECK: .LBB10_4: -; CHECK: i32.const $push{{[0-9]+}}=, 0{{$}} -; CHECK-NEXT: return $pop{{[0-9]+}}{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; OPT-LABEL: ifelse_earlyexits: -; OPT: block {{$}} -; OPT: block {{$}} +; OPT: block {{$}} +; OPT: block {{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} -; OPT: br_if 1, $1{{$}} +; OPT: br_if 1{{$}} ; OPT: br 1{{$}} ; OPT: .LBB10_3: ; OPT: .LBB10_4: -; OPT: i32.const $push{{[0-9]+}}=, 0{{$}} -; OPT-NEXT: return $pop{{[0-9]+}}{{$}} +; OPT: i32.const 0{{$}} +; OPT-NEXT: return{{$}} define i32 @ifelse_earlyexits(i32 %a, i32 %b, i32* %p) { entry: %c = icmp eq i32 %a, 0 @@ -403,13 +403,13 @@ ; CHECK-LABEL: doublediamond_in_a_loop: ; CHECK: .LBB11_1: ; CHECK: loop i32{{$}} -; CHECK: block {{$}} -; CHECK: br_if 0, $0{{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} ; CHECK: br 1{{$}} ; CHECK: .LBB11_3: ; CHECK: end_block{{$}} -; CHECK: block {{$}} -; CHECK: br_if 0, $1{{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} ; CHECK: br 1{{$}} ; CHECK: .LBB11_5: ; CHECK: br 0{{$}} @@ -418,9 +418,9 @@ ; OPT-LABEL: doublediamond_in_a_loop: ; OPT: .LBB11_1: ; OPT: loop i32{{$}} -; OPT: block {{$}} +; OPT: block {{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} -; OPT: block {{$}} +; OPT: block {{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT: br 2{{$}} ; OPT-NEXT: .LBB11_4: @@ -515,16 +515,16 @@ ; CHECK-LABEL: test4: ; CHECK-NEXT: .param i32{{$}} -; CHECK: block {{$}} -; CHECK-NEXT: block {{$}} -; CHECK: br_if 0, $pop{{[0-9]+}}{{$}} -; CHECK: br_if 1, $pop{{[0-9]+}}{{$}} +; CHECK: block {{$}} +; CHECK-NEXT: block {{$}} +; CHECK: br_if 0{{$}} +; CHECK: br_if 1{{$}} ; CHECK: br 1{{$}} ; CHECK-NEXT: .LBB13_3: ; CHECK-NEXT: end_block{{$}} -; CHECK-NEXT: block {{$}} -; CHECK: br_if 0, $pop{{[0-9]+}}{{$}} -; CHECK: br_if 1, $pop{{[0-9]+}}{{$}} +; CHECK-NEXT: block {{$}} +; CHECK: br_if 0{{$}} +; CHECK: br_if 1{{$}} ; CHECK-NEXT: .LBB13_5: ; CHECK-NEXT: end_block{{$}} ; CHECK-NEXT: return{{$}} @@ -533,16 +533,16 @@ ; CHECK-NEXT: return{{$}} ; OPT-LABEL: test4: ; OPT-NEXT: .param i32{{$}} -; OPT: block {{$}} -; OPT-NEXT: block {{$}} -; OPT: br_if 0, $pop{{[0-9]+}}{{$}} -; OPT: br_if 1, $pop{{[0-9]+}}{{$}} +; OPT: block {{$}} +; OPT-NEXT: block {{$}} +; OPT: br_if 0{{$}} +; OPT: br_if 1{{$}} ; OPT: br 1{{$}} ; OPT-NEXT: .LBB13_3: ; OPT-NEXT: end_block{{$}} -; OPT-NEXT: block {{$}} -; OPT: br_if 0, $pop{{[0-9]+}}{{$}} -; OPT: br_if 1, $pop{{[0-9]+}}{{$}} +; OPT-NEXT: block {{$}} +; OPT: br_if 0{{$}} +; OPT: br_if 1{{$}} ; OPT-NEXT: .LBB13_5: ; OPT-NEXT: end_block{{$}} ; OPT-NEXT: return{{$}} @@ -576,8 +576,8 @@ ; CHECK-LABEL: test5: ; CHECK: .LBB14_1: -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK: br_if 1, {{[^,]+}}{{$}} ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK-NEXT: end_loop{{$}} @@ -586,8 +586,8 @@ ; CHECK: return{{$}} ; OPT-LABEL: test5: ; OPT: .LBB14_1: -; OPT-NEXT: block {{$}} -; OPT-NEXT: loop {{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: loop{{$}} ; OPT: br_if 1, {{[^,]+}}{{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT-NEXT: end_loop{{$}} @@ -621,9 +621,9 @@ ; CHECK-LABEL: test6: ; CHECK: .LBB15_1: -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block ; CHECK: br_if 2, {{[^,]+}}{{$}} ; CHECK-NOT: block @@ -642,9 +642,9 @@ ; CHECK: return{{$}} ; OPT-LABEL: test6: ; OPT: .LBB15_1: -; OPT-NEXT: block {{$}} -; OPT-NEXT: block {{$}} -; OPT-NEXT: loop {{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block ; OPT: br_if 2, {{[^,]+}}{{$}} ; OPT-NOT: block @@ -695,9 +695,9 @@ ; CHECK-LABEL: test7: ; CHECK: .LBB16_1: -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block -; CHECK: block {{$}} +; CHECK: block {{$}} ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK-NOT: block ; CHECK: br_if 1, {{[^,]+}}{{$}} @@ -713,9 +713,9 @@ ; OPT-LABEL: test7: ; OPT: .LBB16_1: ; OPT-NEXT: block -; OPT-NEXT: loop {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block -; OPT: block {{$}} +; OPT: block {{$}} ; OPT-NOT: block ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT-NOT: block @@ -763,7 +763,7 @@ ; CHECK-LABEL: test8: ; CHECK: .LBB17_1: ; CHECK-NEXT: loop i32{{$}} -; CHECK-NEXT: i32.const $push{{[^,]+}}, 0{{$}} +; CHECK-NEXT: i32.const 0{{$}} ; CHECK-NEXT: br_if 0, {{[^,]+}}{{$}} ; CHECK-NEXT: br 0{{$}} ; CHECK-NEXT: .LBB17_2: @@ -771,7 +771,7 @@ ; OPT-LABEL: test8: ; OPT: .LBB17_1: ; OPT-NEXT: loop i32{{$}} -; OPT-NEXT: i32.const $push{{[^,]+}}, 0{{$}} +; OPT-NEXT: i32.const 0{{$}} ; OPT-NEXT: br_if 0, {{[^,]+}}{{$}} ; OPT-NEXT: br 0{{$}} ; OPT-NEXT: .LBB17_2: @@ -798,14 +798,14 @@ ; CHECK-LABEL: test9: ; CHECK: .LBB18_1: -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block ; CHECK: br_if 1, {{[^,]+}}{{$}} ; CHECK-NEXT: .LBB18_2: -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block -; CHECK: block {{$}} +; CHECK: block {{$}} ; CHECK-NOT: block ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK-NOT: block @@ -823,14 +823,14 @@ ; CHECK: return{{$}} ; OPT-LABEL: test9: ; OPT: .LBB18_1: -; OPT-NEXT: block {{$}} -; OPT-NEXT: loop {{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block ; OPT: br_if 1, {{[^,]+}}{{$}} ; OPT-NEXT: .LBB18_2: -; OPT-NEXT: loop {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block -; OPT: block {{$}} +; OPT: block {{$}} ; OPT-NOT: block ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT-NOT: block @@ -882,15 +882,15 @@ ; CHECK-LABEL: test10: ; CHECK: .LBB19_1: -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK: .LBB19_3: -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block ; CHECK: .LBB19_4: -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK-NEXT: end_loop{{$}} @@ -908,15 +908,15 @@ ; CHECK-NEXT: .LBB19_10: ; OPT-LABEL: test10: ; OPT: .LBB19_1: -; OPT-NEXT: loop {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT: .LBB19_3: -; OPT-NEXT: block {{$}} -; OPT-NEXT: loop {{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block ; OPT: .LBB19_4: -; OPT-NEXT: loop {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT-NEXT: end_loop{{$}} @@ -970,13 +970,13 @@ ; Test a CFG DAG with interesting merging. ; CHECK-LABEL: test11: -; CHECK: block {{$}} -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: block {{$}} +; CHECK: block {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: block {{$}} ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK-NOT: block -; CHECK: block {{$}} +; CHECK: block {{$}} ; CHECK-NEXT: i32.const ; CHECK-NEXT: br_if 0, {{[^,]+}}{{$}} ; CHECK-NOT: block @@ -1004,11 +1004,11 @@ ; CHECK-NOT: block ; CHECK: return{{$}} ; OPT-LABEL: test11: -; OPT: block {{$}} -; OPT-NEXT: block {{$}} -; OPT: br_if 0, $pop{{[0-9]+}}{{$}} +; OPT: block {{$}} +; OPT-NEXT: block {{$}} +; OPT: br_if 0{{$}} ; OPT-NOT: block -; OPT: block {{$}} +; OPT: block {{$}} ; OPT-NEXT: i32.const ; OPT-NEXT: br_if 0, {{[^,]+}}{{$}} ; OPT-NOT: block @@ -1020,15 +1020,15 @@ ; OPT-NEXT: .LBB20_4: ; OPT-NEXT: end_block{{$}} ; OPT-NOT: block -; OPT: block {{$}} +; OPT: block {{$}} ; OPT-NOT: block -; OPT: br_if 0, $pop{{[0-9]+}}{{$}} +; OPT: br_if 0{{$}} ; OPT-NOT: block ; OPT: return{{$}} ; OPT-NEXT: .LBB20_6: ; OPT-NEXT: end_block{{$}} ; OPT-NOT: block -; OPT: br_if 0, $pop{{[0-9]+}}{{$}} +; OPT: br_if 0{{$}} ; OPT-NOT: block ; OPT: return{{$}} ; OPT-NEXT: .LBB20_8: @@ -1067,11 +1067,11 @@ ; CHECK-LABEL: test12: ; CHECK: .LBB21_1: -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: loop {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: loop{{$}} ; CHECK-NOT: block -; CHECK: block {{$}} -; CHECK-NEXT: block {{$}} +; CHECK: block {{$}} +; CHECK-NEXT: block {{$}} ; CHECK: br_if 0, {{[^,]+}}{{$}} ; CHECK-NOT: block ; CHECK: br_if 1, {{[^,]+}}{{$}} @@ -1094,11 +1094,11 @@ ; CHECK-NEXT: return{{$}} ; OPT-LABEL: test12: ; OPT: .LBB21_1: -; OPT-NEXT: block {{$}} -; OPT-NEXT: loop {{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: loop{{$}} ; OPT-NOT: block -; OPT: block {{$}} -; OPT-NEXT: block {{$}} +; OPT: block {{$}} +; OPT-NEXT: block {{$}} ; OPT: br_if 0, {{[^,]+}}{{$}} ; OPT-NOT: block ; OPT: br_if 1, {{[^,]+}}{{$}} @@ -1146,14 +1146,14 @@ ; optnone to disable optimizations to test this case. ; CHECK-LABEL: test13: -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: block {{$}} -; CHECK: br_if 0, $pop0{{$}} -; CHECK: block {{$}} -; CHECK: br_if 0, $pop3{{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: block {{$}} +; CHECK: br_if 0{{$}} +; CHECK: block {{$}} +; CHECK: br_if 0{{$}} ; CHECK: .LBB22_3: ; CHECK-NEXT: end_block{{$}} -; CHECK: br_if 1, $pop{{[0-9]+}}{{$}} +; CHECK: br_if 1{{$}} ; CHECK-NEXT: br 1{{$}} ; CHECK-NEXT: .LBB22_4: ; CHECK-NEXT: end_block{{$}} @@ -1162,14 +1162,14 @@ ; CHECK-NEXT: end_block{{$}} ; CHECK-NEXT: unreachable{{$}} ; OPT-LABEL: test13: -; OPT-NEXT: block {{$}} -; OPT-NEXT: block {{$}} -; OPT: br_if 0, $pop0{{$}} -; OPT: block {{$}} -; OPT: br_if 0, $pop3{{$}} +; OPT-NEXT: block {{$}} +; OPT-NEXT: block {{$}} +; OPT: br_if 0{{$}} +; OPT: block {{$}} +; OPT: br_if 0{{$}} ; OPT: .LBB22_3: ; OPT-NEXT: end_block{{$}} -; OPT: br_if 1, $pop{{[0-9]+}}{{$}} +; OPT: br_if 1{{$}} ; OPT-NEXT: br 1{{$}} ; OPT-NEXT: .LBB22_4: ; OPT-NEXT: end_block @@ -1199,14 +1199,14 @@ ; CHECK-LABEL: test14: ; CHECK-NEXT: .LBB23_1:{{$}} -; CHECK-NEXT: loop {{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: br_if 0, $pop0{{$}} +; CHECK-NEXT: loop{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: br_if 0{{$}} ; CHECK-NEXT: end_loop{{$}} ; CHECK-NEXT: .LBB23_3:{{$}} -; CHECK-NEXT: loop {{$}} -; CHECK-NEXT: i32.const $push1=, 0{{$}} -; CHECK-NEXT: br_if 0, $pop1{{$}} +; CHECK-NEXT: loop{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: br_if 0{{$}} ; CHECK-NEXT: end_loop{{$}} ; CHECK-NEXT: return{{$}} define void @test14() { @@ -1261,19 +1261,19 @@ ; CHECK-LABEL: test15: ; CHECK: block ; CHECK-NEXT: block -; CHECK: br_if 0, $pop{{.*}}{{$}} +; CHECK: br_if 0{{$}} ; CHECK: .LBB24_2: -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: loop {{$}} -; CHECK: br_if 1, $pop{{.*}}{{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: loop{{$}} +; CHECK: br_if 1{{$}} ; CHECK: br_if 0, ${{.*}}{{$}} ; CHECK-NEXT: br 2{{$}} ; CHECK-NEXT: .LBB24_4: ; CHECK-NEXT: end_loop{{$}} ; CHECK: .LBB24_5: ; CHECK-NEXT: end_block{{$}} -; CHECK: br_if 1, $pop{{.*}}{{$}} +; CHECK: br_if 1{{$}} ; CHECK: return{{$}} ; CHECK: .LBB24_7: ; CHECK-NEXT: end_block{{$}} @@ -1283,9 +1283,9 @@ ; OPT-LABEL: test15: ; OPT: block ; OPT: block -; OPT-NEXT: i32.const $push -; OPT-NEXT: i32.eqz $push{{.*}}=, $pop{{.*}}{{$}} -; OPT-NEXT: br_if 0, $pop{{.*}}{{$}} +; OPT-NEXT: i32.const +; OPT-NEXT: i32.eqz{{$}} +; OPT-NEXT: br_if 0{{$}} ; OPT-NEXT: call test15_callee1@FUNCTION{{$}} ; OPT-NEXT: br 1{{$}} ; OPT-NEXT: .LBB24_2: Index: test/CodeGen/WebAssembly/comparisons_f32.ll =================================================================== --- test/CodeGen/WebAssembly/comparisons_f32.ll +++ test/CodeGen/WebAssembly/comparisons_f32.ll @@ -9,14 +9,14 @@ ; CHECK-LABEL: ord_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f32.eq $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.eq $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: i32.and $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f32.eq{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.eq{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: return{{$}} define i32 @ord_f32(float %x, float %y) { %a = fcmp ord float %x, %y %b = zext i1 %a to i32 @@ -26,14 +26,14 @@ ; CHECK-LABEL: uno_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f32.ne $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.ne $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: i32.or $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f32.ne{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.ne{{$}} +; CHECK-NEXT: i32.or{{$}} +; CHECK-NEXT: return{{$}} define i32 @uno_f32(float %x, float %y) { %a = fcmp uno float %x, %y %b = zext i1 %a to i32 @@ -43,10 +43,10 @@ ; CHECK-LABEL: oeq_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.eq $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.eq{{$}} +; CHECK-NEXT: return{{$}} define i32 @oeq_f32(float %x, float %y) { %a = fcmp oeq float %x, %y %b = zext i1 %a to i32 @@ -54,8 +54,8 @@ } ; CHECK-LABEL: une_f32: -; CHECK: f32.ne $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f32.ne{{$}} +; CHECK-NEXT: return{{$}} define i32 @une_f32(float %x, float %y) { %a = fcmp une float %x, %y %b = zext i1 %a to i32 @@ -63,8 +63,8 @@ } ; CHECK-LABEL: olt_f32: -; CHECK: f32.lt $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f32.lt{{$}} +; CHECK-NEXT: return{{$}} define i32 @olt_f32(float %x, float %y) { %a = fcmp olt float %x, %y %b = zext i1 %a to i32 @@ -72,8 +72,8 @@ } ; CHECK-LABEL: ole_f32: -; CHECK: f32.le $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f32.le{{$}} +; CHECK-NEXT: return{{$}} define i32 @ole_f32(float %x, float %y) { %a = fcmp ole float %x, %y %b = zext i1 %a to i32 @@ -81,8 +81,8 @@ } ; CHECK-LABEL: ogt_f32: -; CHECK: f32.gt $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f32.gt{{$}} +; CHECK-NEXT: return{{$}} define i32 @ogt_f32(float %x, float %y) { %a = fcmp ogt float %x, %y %b = zext i1 %a to i32 @@ -90,8 +90,8 @@ } ; CHECK-LABEL: oge_f32: -; CHECK: f32.ge $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f32.ge{{$}} +; CHECK-NEXT: return{{$}} define i32 @oge_f32(float %x, float %y) { %a = fcmp oge float %x, %y %b = zext i1 %a to i32 @@ -104,18 +104,18 @@ ; CHECK-LABEL: ueq_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.eq $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f32.ne $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: get_local $push[[L4:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L5:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.ne $push[[NUM2:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} -; CHECK-NEXT: i32.or $push[[NUM3:[0-9]+]]=, $pop[[NUM1]], $pop[[NUM2]]{{$}} -; CHECK-NEXT: i32.or $push[[NUM4:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM3]]{{$}} -; CHECK-NEXT: return $pop[[NUM4]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.eq{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f32.ne{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.ne{{$}} +; CHECK-NEXT: i32.or{{$}} +; CHECK-NEXT: i32.or{{$}} +; CHECK-NEXT: return{{$}} define i32 @ueq_f32(float %x, float %y) { %a = fcmp ueq float %x, %y %b = zext i1 %a to i32 @@ -125,18 +125,18 @@ ; CHECK-LABEL: one_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.ne $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f32.eq $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: get_local $push[[L4:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L5:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.eq $push[[NUM2:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} -; CHECK-NEXT: i32.and $push[[NUM3:[0-9]+]]=, $pop[[NUM1]], $pop[[NUM2]]{{$}} -; CHECK-NEXT: i32.and $push[[NUM4:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM3]]{{$}} -; CHECK-NEXT: return $pop[[NUM4]] +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.ne{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f32.eq{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.eq{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: return define i32 @one_f32(float %x, float %y) { %a = fcmp one float %x, %y %b = zext i1 %a to i32 @@ -146,12 +146,12 @@ ; CHECK-LABEL: ult_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.ge $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.ge{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @ult_f32(float %x, float %y) { %a = fcmp ult float %x, %y %b = zext i1 %a to i32 @@ -161,12 +161,12 @@ ; CHECK-LABEL: ule_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.gt $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.gt{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @ule_f32(float %x, float %y) { %a = fcmp ule float %x, %y %b = zext i1 %a to i32 @@ -176,12 +176,12 @@ ; CHECK-LABEL: ugt_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.le $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.le{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @ugt_f32(float %x, float %y) { %a = fcmp ugt float %x, %y %b = zext i1 %a to i32 @@ -191,12 +191,12 @@ ; CHECK-LABEL: uge_f32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.lt $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.lt{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @uge_f32(float %x, float %y) { %a = fcmp uge float %x, %y %b = zext i1 %a to i32 Index: test/CodeGen/WebAssembly/comparisons_f64.ll =================================================================== --- test/CodeGen/WebAssembly/comparisons_f64.ll +++ test/CodeGen/WebAssembly/comparisons_f64.ll @@ -9,14 +9,14 @@ ; CHECK-LABEL: ord_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f64.eq $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.eq $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: i32.and $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f64.eq{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.eq{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: return{{$}} define i32 @ord_f64(double %x, double %y) { %a = fcmp ord double %x, %y %b = zext i1 %a to i32 @@ -26,14 +26,14 @@ ; CHECK-LABEL: uno_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f64.ne $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.ne $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: i32.or $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f64.ne{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.ne{{$}} +; CHECK-NEXT: i32.or{{$}} +; CHECK-NEXT: return{{$}} define i32 @uno_f64(double %x, double %y) { %a = fcmp uno double %x, %y %b = zext i1 %a to i32 @@ -43,10 +43,10 @@ ; CHECK-LABEL: oeq_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.eq $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.eq{{$}} +; CHECK-NEXT: return{{$}} define i32 @oeq_f64(double %x, double %y) { %a = fcmp oeq double %x, %y %b = zext i1 %a to i32 @@ -54,8 +54,8 @@ } ; CHECK-LABEL: une_f64: -; CHECK: f64.ne $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f64.ne{{$}} +; CHECK-NEXT: return{{$}} define i32 @une_f64(double %x, double %y) { %a = fcmp une double %x, %y %b = zext i1 %a to i32 @@ -63,8 +63,8 @@ } ; CHECK-LABEL: olt_f64: -; CHECK: f64.lt $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f64.lt{{$}} +; CHECK-NEXT: return{{$}} define i32 @olt_f64(double %x, double %y) { %a = fcmp olt double %x, %y %b = zext i1 %a to i32 @@ -72,8 +72,8 @@ } ; CHECK-LABEL: ole_f64: -; CHECK: f64.le $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f64.le{{$}} +; CHECK-NEXT: return{{$}} define i32 @ole_f64(double %x, double %y) { %a = fcmp ole double %x, %y %b = zext i1 %a to i32 @@ -81,8 +81,8 @@ } ; CHECK-LABEL: ogt_f64: -; CHECK: f64.gt $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f64.gt{{$}} +; CHECK-NEXT: return{{$}} define i32 @ogt_f64(double %x, double %y) { %a = fcmp ogt double %x, %y %b = zext i1 %a to i32 @@ -90,8 +90,8 @@ } ; CHECK-LABEL: oge_f64: -; CHECK: f64.ge $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: f64.ge{{$}} +; CHECK-NEXT: return{{$}} define i32 @oge_f64(double %x, double %y) { %a = fcmp oge double %x, %y %b = zext i1 %a to i32 @@ -103,18 +103,18 @@ ; CHECK-LABEL: ueq_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.eq $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f64.ne $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: get_local $push[[L4:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L5:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.ne $push[[NUM2:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} -; CHECK-NEXT: i32.or $push[[NUM3:[0-9]+]]=, $pop[[NUM1]], $pop[[NUM2]]{{$}} -; CHECK-NEXT: i32.or $push[[NUM4:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM3]]{{$}} -; CHECK-NEXT: return $pop[[NUM4]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.eq{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f64.ne{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.ne{{$}} +; CHECK-NEXT: i32.or{{$}} +; CHECK-NEXT: i32.or{{$}} +; CHECK-NEXT: return{{$}} define i32 @ueq_f64(double %x, double %y) { %a = fcmp ueq double %x, %y %b = zext i1 %a to i32 @@ -124,18 +124,18 @@ ; CHECK-LABEL: one_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.ne $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: get_local $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L3:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f64.eq $push[[NUM1:[0-9]+]]=, $pop[[L2]], $pop[[L3]]{{$}} -; CHECK-NEXT: get_local $push[[L4:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: get_local $push[[L5:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.eq $push[[NUM2:[0-9]+]]=, $pop[[L4]], $pop[[L5]]{{$}} -; CHECK-NEXT: i32.and $push[[NUM3:[0-9]+]]=, $pop[[NUM1]], $pop[[NUM2]]{{$}} -; CHECK-NEXT: i32.and $push[[NUM4:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM3]]{{$}} -; CHECK-NEXT: return $pop[[NUM4]] +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.ne{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f64.eq{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.eq{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: return define i32 @one_f64(double %x, double %y) { %a = fcmp one double %x, %y %b = zext i1 %a to i32 @@ -145,12 +145,12 @@ ; CHECK-LABEL: ult_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.ge $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.ge{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @ult_f64(double %x, double %y) { %a = fcmp ult double %x, %y %b = zext i1 %a to i32 @@ -160,12 +160,12 @@ ; CHECK-LABEL: ule_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.gt $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.gt{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @ule_f64(double %x, double %y) { %a = fcmp ule double %x, %y %b = zext i1 %a to i32 @@ -175,12 +175,12 @@ ; CHECK-LABEL: ugt_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.le $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.le{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @ugt_f64(double %x, double %y) { %a = fcmp ugt double %x, %y %b = zext i1 %a to i32 @@ -190,12 +190,12 @@ ; CHECK-LABEL: uge_f64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.lt $push[[NUM0:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[C0:[0-9]+]]=, 1 -; CHECK-NEXT: i32.xor $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[C0]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.lt{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @uge_f64(double %x, double %y) { %a = fcmp uge double %x, %y %b = zext i1 %a to i32 Index: test/CodeGen/WebAssembly/comparisons_i32.ll =================================================================== --- test/CodeGen/WebAssembly/comparisons_i32.ll +++ test/CodeGen/WebAssembly/comparisons_i32.ll @@ -9,10 +9,10 @@ ; CHECK-LABEL: eq_i32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.eq $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.eq{{$}} +; CHECK-NEXT: return{{$}} define i32 @eq_i32(i32 %x, i32 %y) { %a = icmp eq i32 %x, %y %b = zext i1 %a to i32 @@ -20,8 +20,8 @@ } ; CHECK-LABEL: ne_i32: -; CHECK: i32.ne $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.ne {{$}} +; CHECK-NEXT: return{{$}} define i32 @ne_i32(i32 %x, i32 %y) { %a = icmp ne i32 %x, %y %b = zext i1 %a to i32 @@ -29,8 +29,8 @@ } ; CHECK-LABEL: slt_i32: -; CHECK: i32.lt_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.lt_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @slt_i32(i32 %x, i32 %y) { %a = icmp slt i32 %x, %y %b = zext i1 %a to i32 @@ -38,8 +38,8 @@ } ; CHECK-LABEL: sle_i32: -; CHECK: i32.le_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.le_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sle_i32(i32 %x, i32 %y) { %a = icmp sle i32 %x, %y %b = zext i1 %a to i32 @@ -47,8 +47,8 @@ } ; CHECK-LABEL: ult_i32: -; CHECK: i32.lt_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.lt_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @ult_i32(i32 %x, i32 %y) { %a = icmp ult i32 %x, %y %b = zext i1 %a to i32 @@ -56,8 +56,8 @@ } ; CHECK-LABEL: ule_i32: -; CHECK: i32.le_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.le_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @ule_i32(i32 %x, i32 %y) { %a = icmp ule i32 %x, %y %b = zext i1 %a to i32 @@ -65,8 +65,8 @@ } ; CHECK-LABEL: sgt_i32: -; CHECK: i32.gt_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.gt_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sgt_i32(i32 %x, i32 %y) { %a = icmp sgt i32 %x, %y %b = zext i1 %a to i32 @@ -74,8 +74,8 @@ } ; CHECK-LABEL: sge_i32: -; CHECK: i32.ge_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.ge_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sge_i32(i32 %x, i32 %y) { %a = icmp sge i32 %x, %y %b = zext i1 %a to i32 @@ -83,8 +83,8 @@ } ; CHECK-LABEL: ugt_i32: -; CHECK: i32.gt_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.gt_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @ugt_i32(i32 %x, i32 %y) { %a = icmp ugt i32 %x, %y %b = zext i1 %a to i32 @@ -92,8 +92,8 @@ } ; CHECK-LABEL: uge_i32: -; CHECK: i32.ge_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.ge_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @uge_i32(i32 %x, i32 %y) { %a = icmp uge i32 %x, %y %b = zext i1 %a to i32 Index: test/CodeGen/WebAssembly/comparisons_i64.ll =================================================================== --- test/CodeGen/WebAssembly/comparisons_i64.ll +++ test/CodeGen/WebAssembly/comparisons_i64.ll @@ -9,10 +9,10 @@ ; CHECK-LABEL: eq_i64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.eq $push[[NUM:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.eq{{$}} +; CHECK-NEXT: return{{$}} define i32 @eq_i64(i64 %x, i64 %y) { %a = icmp eq i64 %x, %y %b = zext i1 %a to i32 @@ -20,8 +20,8 @@ } ; CHECK-LABEL: ne_i64: -; CHECK: i64.ne $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.ne{{$}} +; CHECK-NEXT: return{{$}} define i32 @ne_i64(i64 %x, i64 %y) { %a = icmp ne i64 %x, %y %b = zext i1 %a to i32 @@ -29,8 +29,8 @@ } ; CHECK-LABEL: slt_i64: -; CHECK: i64.lt_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.lt_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @slt_i64(i64 %x, i64 %y) { %a = icmp slt i64 %x, %y %b = zext i1 %a to i32 @@ -38,8 +38,8 @@ } ; CHECK-LABEL: sle_i64: -; CHECK: i64.le_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.le_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sle_i64(i64 %x, i64 %y) { %a = icmp sle i64 %x, %y %b = zext i1 %a to i32 @@ -47,8 +47,8 @@ } ; CHECK-LABEL: ult_i64: -; CHECK: i64.lt_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.lt_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @ult_i64(i64 %x, i64 %y) { %a = icmp ult i64 %x, %y %b = zext i1 %a to i32 @@ -56,8 +56,8 @@ } ; CHECK-LABEL: ule_i64: -; CHECK: i64.le_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.le_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @ule_i64(i64 %x, i64 %y) { %a = icmp ule i64 %x, %y %b = zext i1 %a to i32 @@ -65,8 +65,8 @@ } ; CHECK-LABEL: sgt_i64: -; CHECK: i64.gt_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.gt_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sgt_i64(i64 %x, i64 %y) { %a = icmp sgt i64 %x, %y %b = zext i1 %a to i32 @@ -74,8 +74,8 @@ } ; CHECK-LABEL: sge_i64: -; CHECK: i64.ge_s $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.ge_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sge_i64(i64 %x, i64 %y) { %a = icmp sge i64 %x, %y %b = zext i1 %a to i32 @@ -83,8 +83,8 @@ } ; CHECK-LABEL: ugt_i64: -; CHECK: i64.gt_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.gt_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @ugt_i64(i64 %x, i64 %y) { %a = icmp ugt i64 %x, %y %b = zext i1 %a to i32 @@ -92,8 +92,8 @@ } ; CHECK-LABEL: uge_i64: -; CHECK: i64.ge_u $push[[NUM:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.ge_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @uge_i64(i64 %x, i64 %y) { %a = icmp uge i64 %x, %y %b = zext i1 %a to i32 Index: test/CodeGen/WebAssembly/conv-trap.ll =================================================================== --- test/CodeGen/WebAssembly/conv-trap.ll +++ test/CodeGen/WebAssembly/conv-trap.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -mattr=-nontrapping-fptoint | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -mattr=-nontrapping-fptoint | FileCheck %s ; Test that basic conversion operations assemble as expected using ; the trapping opcodes and explicit code to suppress the trapping. @@ -10,16 +10,16 @@ ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i32{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f32.abs $push[[ABS:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: f32.const $push[[LIMIT:[0-9]+]]=, 0x1p31{{$}} -; CHECK-NEXT: f32.lt $push[[LT:[0-9]+]]=, $pop[[ABS]], $pop[[LIMIT]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[LT]]{{$}} -; CHECK-NEXT: i32.const $push[[ALT:[0-9]+]]=, -2147483648{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f32.abs +; CHECK-NEXT: f32.const 0x1p31{{$}} +; CHECK-NEXT: f32.lt{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i32.const -2147483648{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i32.trunc_s/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_s/f32 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_s_f32(float %x) { %a = fptosi float %x to i32 ret i32 %a @@ -29,18 +29,18 @@ ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i32{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f32.const $push[[LIMIT:[0-9]+]]=, 0x1p32{{$}} -; CHECK-NEXT: f32.lt $push[[LT:[0-9]+]]=, $0, $pop[[LIMIT]]{{$}} -; CHECK-NEXT: f32.const $push[[ZERO:[0-9]+]]=, 0x0p0{{$}} -; CHECK-NEXT: f32.ge $push[[GE:[0-9]+]]=, $0, $pop[[ZERO]]{{$}} -; CHECK-NEXT: i32.and $push[[AND:[0-9]+]]=, $pop[[LT]], $pop[[GE]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[AND]]{{$}} -; CHECK-NEXT: i32.const $push[[ALT:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f32.const 0x1p32{{$}} +; CHECK-NEXT: f32.lt +; CHECK-NEXT: f32.const 0x0p0{{$}} +; CHECK-NEXT: f32.ge +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i32.trunc_u/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_u/f32 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_u_f32(float %x) { %a = fptoui float %x to i32 ret i32 %a @@ -50,16 +50,16 @@ ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i32{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f64.abs $push[[ABS:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: f64.const $push[[LIMIT:[0-9]+]]=, 0x1p31{{$}} -; CHECK-NEXT: f64.lt $push[[LT:[0-9]+]]=, $pop[[ABS]], $pop[[LIMIT]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[LT]]{{$}} -; CHECK-NEXT: i32.const $push[[ALT:[0-9]+]]=, -2147483648{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f64.abs +; CHECK-NEXT: f64.const 0x1p31{{$}} +; CHECK-NEXT: f64.lt{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i32.const -2147483648{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i32.trunc_s/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_s/f64 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_s_f64(double %x) { %a = fptosi double %x to i32 ret i32 %a @@ -69,18 +69,18 @@ ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i32{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f64.const $push[[LIMIT:[0-9]+]]=, 0x1p32{{$}} -; CHECK-NEXT: f64.lt $push[[LT:[0-9]+]]=, $0, $pop[[LIMIT]]{{$}} -; CHECK-NEXT: f64.const $push[[ZERO:[0-9]+]]=, 0x0p0{{$}} -; CHECK-NEXT: f64.ge $push[[GE:[0-9]+]]=, $0, $pop[[ZERO]]{{$}} -; CHECK-NEXT: i32.and $push[[AND:[0-9]+]]=, $pop[[LT]], $pop[[GE]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[AND]]{{$}} -; CHECK-NEXT: i32.const $push[[ALT:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f64.const 0x1p32{{$}} +; CHECK-NEXT: f64.lt +; CHECK-NEXT: f64.const 0x0p0{{$}} +; CHECK-NEXT: f64.ge +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i32.trunc_u/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_u/f64 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_u_f64(double %x) { %a = fptoui double %x to i32 ret i32 %a @@ -90,16 +90,16 @@ ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i64{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f32.abs $push[[ABS:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: f32.const $push[[LIMIT:[0-9]+]]=, 0x1p63{{$}} -; CHECK-NEXT: f32.lt $push[[LT:[0-9]+]]=, $pop[[ABS]], $pop[[LIMIT]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[LT]]{{$}} -; CHECK-NEXT: i64.const $push[[ALT:[0-9]+]]=, -9223372036854775808{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f32.abs +; CHECK-NEXT: f32.const 0x1p63{{$}} +; CHECK-NEXT: f32.lt{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i64.const -9223372036854775808{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i64.trunc_s/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_s/f32 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_s_f32(float %x) { %a = fptosi float %x to i64 ret i64 %a @@ -109,18 +109,18 @@ ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i64{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f32.const $push[[LIMIT:[0-9]+]]=, 0x1p64{{$}} -; CHECK-NEXT: f32.lt $push[[LT:[0-9]+]]=, $0, $pop[[LIMIT]]{{$}} -; CHECK-NEXT: f32.const $push[[ZERO:[0-9]+]]=, 0x0p0{{$}} -; CHECK-NEXT: f32.ge $push[[GE:[0-9]+]]=, $0, $pop[[ZERO]]{{$}} -; CHECK-NEXT: i32.and $push[[AND:[0-9]+]]=, $pop[[LT]], $pop[[GE]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[AND]]{{$}} -; CHECK-NEXT: i64.const $push[[ALT:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f32.const 0x1p64{{$}} +; CHECK-NEXT: f32.lt +; CHECK-NEXT: f32.const 0x0p0{{$}} +; CHECK-NEXT: f32.ge +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i64.const 0{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i64.trunc_u/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_u/f32 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_u_f32(float %x) { %a = fptoui float %x to i64 ret i64 %a @@ -130,16 +130,16 @@ ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i64{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f64.abs $push[[ABS:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: f64.const $push[[LIMIT:[0-9]+]]=, 0x1p63{{$}} -; CHECK-NEXT: f64.lt $push[[LT:[0-9]+]]=, $pop[[ABS]], $pop[[LIMIT]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[LT]]{{$}} -; CHECK-NEXT: i64.const $push[[ALT:[0-9]+]]=, -9223372036854775808{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f64.abs +; CHECK-NEXT: f64.const 0x1p63{{$}} +; CHECK-NEXT: f64.lt{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i64.const -9223372036854775808{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i64.trunc_s/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_s/f64 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_s_f64(double %x) { %a = fptosi double %x to i64 ret i64 %a @@ -149,18 +149,18 @@ ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i64{{$}} ; CHECK-NEXT: block -; CHECK-NEXT: f64.const $push[[LIMIT:[0-9]+]]=, 0x1p64{{$}} -; CHECK-NEXT: f64.lt $push[[LT:[0-9]+]]=, $0, $pop[[LIMIT]]{{$}} -; CHECK-NEXT: f64.const $push[[ZERO:[0-9]+]]=, 0x0p0{{$}} -; CHECK-NEXT: f64.ge $push[[GE:[0-9]+]]=, $0, $pop[[ZERO]]{{$}} -; CHECK-NEXT: i32.and $push[[AND:[0-9]+]]=, $pop[[LT]], $pop[[GE]]{{$}} -; CHECK-NEXT: br_if 0, $pop[[AND]]{{$}} -; CHECK-NEXT: i64.const $push[[ALT:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[ALT]]{{$}} +; CHECK-NEXT: f64.const 0x1p64{{$}} +; CHECK-NEXT: f64.lt +; CHECK-NEXT: f64.const 0x0p0{{$}} +; CHECK-NEXT: f64.ge +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i64.const 0{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: BB ; CHECK-NEXT: end_block -; CHECK-NEXT: i64.trunc_u/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_u/f64 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_u_f64(double %x) { %a = fptoui double %x to i64 ret i64 %a Index: test/CodeGen/WebAssembly/conv.ll =================================================================== --- test/CodeGen/WebAssembly/conv.ll +++ test/CodeGen/WebAssembly/conv.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -mattr=+nontrapping-fptoint | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -mattr=+nontrapping-fptoint | FileCheck %s ; Test that basic conversion operations assemble as expected. @@ -8,8 +8,8 @@ ; CHECK-LABEL: i32_wrap_i64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.wrap/i64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.wrap/i64 +; CHECK-NEXT: return{{$}} define i32 @i32_wrap_i64(i64 %x) { %a = trunc i64 %x to i32 ret i32 %a @@ -18,8 +18,8 @@ ; CHECK-LABEL: i64_extend_s_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.extend_s/i32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.extend_s/i32 +; CHECK-NEXT: return{{$}} define i64 @i64_extend_s_i32(i32 %x) { %a = sext i32 %x to i64 ret i64 %a @@ -28,8 +28,8 @@ ; CHECK-LABEL: i64_extend_u_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.extend_u/i32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.extend_u/i32 +; CHECK-NEXT: return{{$}} define i64 @i64_extend_u_i32(i32 %x) { %a = zext i32 %x to i64 ret i64 %a @@ -38,8 +38,8 @@ ; CHECK-LABEL: i32_trunc_s_f32: ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.trunc_s:sat/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_s:sat/f32 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_s_f32(float %x) { %a = fptosi float %x to i32 ret i32 %a @@ -48,8 +48,8 @@ ; CHECK-LABEL: i32_trunc_u_f32: ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.trunc_u:sat/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_u:sat/f32 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_u_f32(float %x) { %a = fptoui float %x to i32 ret i32 %a @@ -58,8 +58,8 @@ ; CHECK-LABEL: i32_trunc_s_f64: ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.trunc_s:sat/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_s:sat/f64 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_s_f64(double %x) { %a = fptosi double %x to i32 ret i32 %a @@ -68,8 +68,8 @@ ; CHECK-LABEL: i32_trunc_u_f64: ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.trunc_u:sat/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.trunc_u:sat/f64 +; CHECK-NEXT: return{{$}} define i32 @i32_trunc_u_f64(double %x) { %a = fptoui double %x to i32 ret i32 %a @@ -78,8 +78,8 @@ ; CHECK-LABEL: i64_trunc_s_f32: ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.trunc_s:sat/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_s:sat/f32 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_s_f32(float %x) { %a = fptosi float %x to i64 ret i64 %a @@ -88,8 +88,8 @@ ; CHECK-LABEL: i64_trunc_u_f32: ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.trunc_u:sat/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_u:sat/f32 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_u_f32(float %x) { %a = fptoui float %x to i64 ret i64 %a @@ -98,8 +98,8 @@ ; CHECK-LABEL: i64_trunc_s_f64: ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.trunc_s:sat/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_s:sat/f64 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_s_f64(double %x) { %a = fptosi double %x to i64 ret i64 %a @@ -108,8 +108,8 @@ ; CHECK-LABEL: i64_trunc_u_f64: ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.trunc_u:sat/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.trunc_u:sat/f64 +; CHECK-NEXT: return{{$}} define i64 @i64_trunc_u_f64(double %x) { %a = fptoui double %x to i64 ret i64 %a @@ -118,8 +118,8 @@ ; CHECK-LABEL: f32_convert_s_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.convert_s/i32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.convert_s/i32 +; CHECK-NEXT: return{{$}} define float @f32_convert_s_i32(i32 %x) { %a = sitofp i32 %x to float ret float %a @@ -128,8 +128,8 @@ ; CHECK-LABEL: f32_convert_u_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.convert_u/i32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.convert_u/i32 +; CHECK-NEXT: return{{$}} define float @f32_convert_u_i32(i32 %x) { %a = uitofp i32 %x to float ret float %a @@ -138,8 +138,8 @@ ; CHECK-LABEL: f64_convert_s_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.convert_s/i32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.convert_s/i32 +; CHECK-NEXT: return{{$}} define double @f64_convert_s_i32(i32 %x) { %a = sitofp i32 %x to double ret double %a @@ -148,8 +148,8 @@ ; CHECK-LABEL: f64_convert_u_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.convert_u/i32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.convert_u/i32 +; CHECK-NEXT: return{{$}} define double @f64_convert_u_i32(i32 %x) { %a = uitofp i32 %x to double ret double %a @@ -158,8 +158,8 @@ ; CHECK-LABEL: f32_convert_s_i64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.convert_s/i64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.convert_s/i64 +; CHECK-NEXT: return{{$}} define float @f32_convert_s_i64(i64 %x) { %a = sitofp i64 %x to float ret float %a @@ -168,8 +168,8 @@ ; CHECK-LABEL: f32_convert_u_i64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.convert_u/i64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.convert_u/i64 +; CHECK-NEXT: return{{$}} define float @f32_convert_u_i64(i64 %x) { %a = uitofp i64 %x to float ret float %a @@ -178,8 +178,8 @@ ; CHECK-LABEL: f64_convert_s_i64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.convert_s/i64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.convert_s/i64 +; CHECK-NEXT: return{{$}} define double @f64_convert_s_i64(i64 %x) { %a = sitofp i64 %x to double ret double %a @@ -188,8 +188,8 @@ ; CHECK-LABEL: f64_convert_u_i64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.convert_u/i64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.convert_u/i64 +; CHECK-NEXT: return{{$}} define double @f64_convert_u_i64(i64 %x) { %a = uitofp i64 %x to double ret double %a @@ -198,8 +198,8 @@ ; CHECK-LABEL: f64_promote_f32: ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.promote/f32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.promote/f32 +; CHECK-NEXT: return{{$}} define double @f64_promote_f32(float %x) { %a = fpext float %x to double ret double %a @@ -208,8 +208,8 @@ ; CHECK-LABEL: f32_demote_f64: ; CHECK-NEXT: .param f64{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.demote/f64 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.demote/f64 +; CHECK-NEXT: return{{$}} define float @f32_demote_f64(double %x) { %a = fptrunc double %x to float ret float %a @@ -219,7 +219,7 @@ ; we need to patterm-match back to a specific instruction. ; CHECK-LABEL: anyext: -; CHECK: i64.extend_u/i32 $push0=, $0{{$}} +; CHECK: i64.extend_u/i32 define i64 @anyext(i32 %x) { %y = sext i32 %x to i64 %w = shl i64 %y, 32 @@ -227,28 +227,28 @@ } ; CHECK-LABEL: bitcast_i32_to_float: -; CHECK: f32.reinterpret/i32 $push0=, $0{{$}} +; CHECK: f32.reinterpret/i32 define float @bitcast_i32_to_float(i32 %a) { %t = bitcast i32 %a to float ret float %t } ; CHECK-LABEL: bitcast_float_to_i32: -; CHECK: i32.reinterpret/f32 $push0=, $0{{$}} +; CHECK: i32.reinterpret/f32 define i32 @bitcast_float_to_i32(float %a) { %t = bitcast float %a to i32 ret i32 %t } ; CHECK-LABEL: bitcast_i64_to_double: -; CHECK: f64.reinterpret/i64 $push0=, $0{{$}} +; CHECK: f64.reinterpret/i64 define double @bitcast_i64_to_double(i64 %a) { %t = bitcast i64 %a to double ret double %t } ; CHECK-LABEL: bitcast_double_to_i64: -; CHECK: i64.reinterpret/f64 $push0=, $0{{$}} +; CHECK: i64.reinterpret/f64 define i64 @bitcast_double_to_i64(double %a) { %t = bitcast double %a to i64 ret i64 %t Index: test/CodeGen/WebAssembly/copysign-casts.ll =================================================================== --- test/CodeGen/WebAssembly/copysign-casts.ll +++ test/CodeGen/WebAssembly/copysign-casts.ll @@ -10,8 +10,8 @@ declare float @copysignf(float, float) nounwind readnone ; CHECK-LABEL: fold_promote: -; CHECK: f64.promote/f32 $push0=, $pop{{[0-9]+}}{{$}} -; CHECK: f64.copysign $push1=, $pop{{[0-9]+}}, $pop0{{$}} +; CHECK: f64.promote/f32{{$}} +; CHECK: f64.copysign{{$}} define double @fold_promote(double %a, float %b) { %c = fpext float %b to double %t = call double @copysign(double %a, double %c) @@ -19,8 +19,8 @@ } ; CHECK-LABEL: fold_demote:{{$}} -; CHECK: f32.demote/f64 $push0=, $pop{{[0-9]+}}{{$}} -; CHECK: f32.copysign $push1=, $pop{{[0-9]+}}, $pop0{{$}} +; CHECK: f32.demote/f64{{$}} +; CHECK: f32.copysign{{$}} define float @fold_demote(float %a, double %b) { %c = fptrunc double %b to float %t = call float @copysignf(float %a, float %c) Index: test/CodeGen/WebAssembly/exception.ll =================================================================== --- test/CodeGen/WebAssembly/exception.ll +++ test/CodeGen/WebAssembly/exception.ll @@ -10,8 +10,8 @@ declare void @llvm.wasm.throw(i32, i8*) ; CHECK-LABEL: test_throw: -; CHECK-NEXT: i32.const $push0=, 0 -; CHECK-NEXT: throw 0, $pop0 +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: throw 0 define void @test_throw() { call void @llvm.wasm.throw(i32 0, i8* null) ret void @@ -19,11 +19,11 @@ ; CHECK-LABEL: test_catch_rethrow: ; CHECK: call foo@FUNCTION -; CHECK: i32.catch $push{{.+}}=, 0 +; CHECK: i32.catch 0 ; CHECK-DAG: i32.store __wasm_lpad_context ; CHECK-DAG: i32.store __wasm_lpad_context+4 -; CHECK: i32.call $push{{.+}}=, _Unwind_CallPersonality@FUNCTION -; CHECK: i32.call $push{{.+}}=, __cxa_begin_catch@FUNCTION +; CHECK: i32.call _Unwind_CallPersonality@FUNCTION +; CHECK: i32.call __cxa_begin_catch@FUNCTION ; CHECK: call __cxa_end_catch@FUNCTION ; CHECK: call __cxa_rethrow@FUNCTION ; CHECK-NEXT: rethrow @@ -59,7 +59,7 @@ ; CHECK-LABEL: test_cleanup: ; CHECK: call foo@FUNCTION ; CHECK: catch_all -; CHECK: i32.call $push20=, _ZN7CleanupD1Ev@FUNCTION +; CHECK: i32.call _ZN7CleanupD1Ev@FUNCTION ; CHECK: rethrow define void @test_cleanup() personality i8* bitcast (i32 (...)* @__gxx_wasm_personality_v0 to i8*) { entry: Index: test/CodeGen/WebAssembly/explicit-locals.mir =================================================================== --- test/CodeGen/WebAssembly/explicit-locals.mir +++ test/CodeGen/WebAssembly/explicit-locals.mir @@ -17,7 +17,7 @@ bb.1: ; predecessors: %bb.0 ; CHECK-NOT: dead %{{[0-9]+}} - ; CHECK: DROP_I32 killed %{{[0-9]+}} + ; CHECK: DROP_I32_S killed %{{[0-9]+}} dead %0:i32 = CONST_I32 0, implicit-def dead $arguments, implicit $sp32, implicit $sp64 RETURN_VOID implicit-def dead $arguments ... Index: test/CodeGen/WebAssembly/f16.ll =================================================================== --- test/CodeGen/WebAssembly/f16.ll +++ test/CodeGen/WebAssembly/f16.ll @@ -9,10 +9,10 @@ ; CHECK-LABEL: demote: ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.call $push[[L1:[0-9]+]]=, __gnu_f2h_ieee@FUNCTION, $pop[[L0]]{{$}} -; CHECK-NEXT: f32.call $push[[L2:[0-9]+]]=, __gnu_h2f_ieee@FUNCTION, $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[L2]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.call __gnu_f2h_ieee@FUNCTION{{$}} +; CHECK-NEXT: f32.call __gnu_h2f_ieee@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} define half @demote(float %f) { %t = fptrunc float %f to half ret half %t @@ -21,8 +21,8 @@ ; CHECK-LABEL: promote: ; CHECK-NEXT: .param f32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: get_local $push0=, 0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: return{{$}} define float @promote(half %f) { %t = fpext half %f to float ret float %t Index: test/CodeGen/WebAssembly/f32.ll =================================================================== --- test/CodeGen/WebAssembly/f32.ll +++ test/CodeGen/WebAssembly/f32.ll @@ -18,106 +18,106 @@ ; CHECK-LABEL: fadd32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.add $push[[LR:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.add {{$}} +; CHECK-NEXT: return{{$}} define float @fadd32(float %x, float %y) { %a = fadd float %x, %y ret float %a } ; CHECK-LABEL: fsub32: -; CHECK: f32.sub $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.sub{{$}} +; CHECK-NEXT: return{{$}} define float @fsub32(float %x, float %y) { %a = fsub float %x, %y ret float %a } ; CHECK-LABEL: fmul32: -; CHECK: f32.mul $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.mul{{$}} +; CHECK-NEXT: return{{$}} define float @fmul32(float %x, float %y) { %a = fmul float %x, %y ret float %a } ; CHECK-LABEL: fdiv32: -; CHECK: f32.div $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.div{{$}} +; CHECK-NEXT: return{{$}} define float @fdiv32(float %x, float %y) { %a = fdiv float %x, %y ret float %a } ; CHECK-LABEL: fabs32: -; CHECK: f32.abs $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.abs{{$}} +; CHECK-NEXT: return{{$}} define float @fabs32(float %x) { %a = call float @llvm.fabs.f32(float %x) ret float %a } ; CHECK-LABEL: fneg32: -; CHECK: f32.neg $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.neg{{$}} +; CHECK-NEXT: return{{$}} define float @fneg32(float %x) { %a = fsub float -0., %x ret float %a } ; CHECK-LABEL: copysign32: -; CHECK: f32.copysign $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.copysign{{$}} +; CHECK-NEXT: return{{$}} define float @copysign32(float %x, float %y) { %a = call float @llvm.copysign.f32(float %x, float %y) ret float %a } ; CHECK-LABEL: sqrt32: -; CHECK: f32.sqrt $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.sqrt{{$}} +; CHECK-NEXT: return{{$}} define float @sqrt32(float %x) { %a = call float @llvm.sqrt.f32(float %x) ret float %a } ; CHECK-LABEL: ceil32: -; CHECK: f32.ceil $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.ceil{{$}} +; CHECK-NEXT: return{{$}} define float @ceil32(float %x) { %a = call float @llvm.ceil.f32(float %x) ret float %a } ; CHECK-LABEL: floor32: -; CHECK: f32.floor $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.floor{{$}} +; CHECK-NEXT: return{{$}} define float @floor32(float %x) { %a = call float @llvm.floor.f32(float %x) ret float %a } ; CHECK-LABEL: trunc32: -; CHECK: f32.trunc $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.trunc{{$}} +; CHECK-NEXT: return{{$}} define float @trunc32(float %x) { %a = call float @llvm.trunc.f32(float %x) ret float %a } ; CHECK-LABEL: nearest32: -; CHECK: f32.nearest $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.nearest{{$}} +; CHECK-NEXT: return{{$}} define float @nearest32(float %x) { %a = call float @llvm.nearbyint.f32(float %x) ret float %a } ; CHECK-LABEL: nearest32_via_rint: -; CHECK: f32.nearest $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f32.nearest{{$}} +; CHECK-NEXT: return{{$}} define float @nearest32_via_rint(float %x) { %a = call float @llvm.rint.f32(float %x) ret float %a @@ -130,8 +130,8 @@ ; tests. ; CHECK-LABEL: fmin32: -; CHECK: f32.min $push1=, $pop{{[0-9]+}}, $pop[[LR]]{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: f32.min{{$}} +; CHECK-NEXT: return{{$}} define float @fmin32(float %x) { %a = fcmp ult float %x, 0.0 %b = select i1 %a, float %x, float 0.0 @@ -139,8 +139,8 @@ } ; CHECK-LABEL: fmax32: -; CHECK: f32.max $push1=, $pop{{[0-9]+}}, $pop[[LR]]{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: f32.max{{$}} +; CHECK-NEXT: return{{$}} define float @fmax32(float %x) { %a = fcmp ugt float %x, 0.0 %b = select i1 %a, float %x, float 0.0 @@ -148,8 +148,8 @@ } ; CHECK-LABEL: fma32: -; CHECK: {{^}} f32.call $push[[LR:[0-9]+]]=, fmaf@FUNCTION, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: {{^}} f32.call fmaf@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define float @fma32(float %a, float %b, float %c) { %d = call float @llvm.fma.f32(float %a, float %b, float %c) ret float %d Index: test/CodeGen/WebAssembly/f64.ll =================================================================== --- test/CodeGen/WebAssembly/f64.ll +++ test/CodeGen/WebAssembly/f64.ll @@ -18,106 +18,106 @@ ; CHECK-LABEL: fadd64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.add $push[[LR:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.add {{$}} +; CHECK-NEXT: return{{$}} define double @fadd64(double %x, double %y) { %a = fadd double %x, %y ret double %a } ; CHECK-LABEL: fsub64: -; CHECK: f64.sub $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.sub{{$}} +; CHECK-NEXT: return{{$}} define double @fsub64(double %x, double %y) { %a = fsub double %x, %y ret double %a } ; CHECK-LABEL: fmul64: -; CHECK: f64.mul $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.mul{{$}} +; CHECK-NEXT: return{{$}} define double @fmul64(double %x, double %y) { %a = fmul double %x, %y ret double %a } ; CHECK-LABEL: fdiv64: -; CHECK: f64.div $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.div{{$}} +; CHECK-NEXT: return{{$}} define double @fdiv64(double %x, double %y) { %a = fdiv double %x, %y ret double %a } ; CHECK-LABEL: fabs64: -; CHECK: f64.abs $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.abs{{$}} +; CHECK-NEXT: return{{$}} define double @fabs64(double %x) { %a = call double @llvm.fabs.f64(double %x) ret double %a } ; CHECK-LABEL: fneg64: -; CHECK: f64.neg $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.neg{{$}} +; CHECK-NEXT: return{{$}} define double @fneg64(double %x) { %a = fsub double -0., %x ret double %a } ; CHECK-LABEL: copysign64: -; CHECK: f64.copysign $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.copysign{{$}} +; CHECK-NEXT: return{{$}} define double @copysign64(double %x, double %y) { %a = call double @llvm.copysign.f64(double %x, double %y) ret double %a } ; CHECK-LABEL: sqrt64: -; CHECK: f64.sqrt $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.sqrt{{$}} +; CHECK-NEXT: return{{$}} define double @sqrt64(double %x) { %a = call double @llvm.sqrt.f64(double %x) ret double %a } ; CHECK-LABEL: ceil64: -; CHECK: f64.ceil $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.ceil{{$}} +; CHECK-NEXT: return{{$}} define double @ceil64(double %x) { %a = call double @llvm.ceil.f64(double %x) ret double %a } ; CHECK-LABEL: floor64: -; CHECK: f64.floor $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.floor{{$}} +; CHECK-NEXT: return{{$}} define double @floor64(double %x) { %a = call double @llvm.floor.f64(double %x) ret double %a } ; CHECK-LABEL: trunc64: -; CHECK: f64.trunc $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.trunc{{$}} +; CHECK-NEXT: return{{$}} define double @trunc64(double %x) { %a = call double @llvm.trunc.f64(double %x) ret double %a } ; CHECK-LABEL: nearest64: -; CHECK: f64.nearest $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.nearest{{$}} +; CHECK-NEXT: return{{$}} define double @nearest64(double %x) { %a = call double @llvm.nearbyint.f64(double %x) ret double %a } ; CHECK-LABEL: nearest64_via_rint: -; CHECK: f64.nearest $push[[LR:[0-9]+]]=, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: f64.nearest{{$}} +; CHECK-NEXT: return{{$}} define double @nearest64_via_rint(double %x) { %a = call double @llvm.rint.f64(double %x) ret double %a @@ -130,8 +130,8 @@ ; tests. ; CHECK-LABEL: fmin64: -; CHECK: f64.min $push1=, $pop{{[0-9]+}}, $pop[[LR]]{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: f64.min{{$}} +; CHECK-NEXT: return{{$}} define double @fmin64(double %x) { %a = fcmp ult double %x, 0.0 %b = select i1 %a, double %x, double 0.0 @@ -139,8 +139,8 @@ } ; CHECK-LABEL: fmax64: -; CHECK: f64.max $push1=, $pop{{[0-9]+}}, $pop[[LR]]{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: f64.max{{$}} +; CHECK-NEXT: return{{$}} define double @fmax64(double %x) { %a = fcmp ugt double %x, 0.0 %b = select i1 %a, double %x, double 0.0 @@ -148,8 +148,8 @@ } ; CHECK-LABEL: fma64: -; CHECK: {{^}} f64.call $push[[LR:[0-9]+]]=, fma@FUNCTION, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: return $pop[[LR]]{{$}} +; CHECK: {{^}} f64.call fma@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define double @fma64(double %a, double %b, double %c) { %d = call double @llvm.fma.f64(double %a, double %b, double %c) ret double %d Index: test/CodeGen/WebAssembly/fast-isel-br-i1.ll =================================================================== --- test/CodeGen/WebAssembly/fast-isel-br-i1.ll +++ test/CodeGen/WebAssembly/fast-isel-br-i1.ll @@ -9,14 +9,14 @@ ; i1 value in LLVM IR, that we only test the low bit. ; CHECK: i32.xor -; CHECK: i32.const $push[[L0:[0-9]+]]=, 1{{$}} -; CHECK: i32.and $push[[L1:[0-9]+]]=, $pop{{[0-9]+}}, $pop[[L0]]{{$}} -; CHECK: br_if 0, $pop[[L1]]{{$}} +; CHECK: i32.const 1{{$}} +; CHECK: i32.and +; CHECK: br_if 0{{$}} ; CHECK: i32.xor -; CHECK: i32.const $push[[L2:[0-9]+]]=, 1{{$}} -; CHECK: i32.and $push[[L3:[0-9]+]]=, $pop{{[0-9]+}}, $pop[[L2]]{{$}} -; CHECK: br_if 0, $pop[[L3]]{{$}} +; CHECK: i32.const 1{{$}} +; CHECK: i32.and +; CHECK: br_if 0{{$}} define void @test() { start: Index: test/CodeGen/WebAssembly/fast-isel-i24.ll =================================================================== --- test/CodeGen/WebAssembly/fast-isel-i24.ll +++ test/CodeGen/WebAssembly/fast-isel-i24.ll @@ -10,9 +10,9 @@ ; CHECK-LABEL: add: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push2=, 0{{$}} -; CHECK-NEXT: get_local $push1=, 1{{$}} -; CHECK-NEXT: i32.add $push0=, $pop2, $pop1{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.add {{$}} ; CHECK-NEXT: end_function define i24 @add(i24 %x, i24 %y) { %z = add i24 %x, %y @@ -21,7 +21,7 @@ ; CHECK-LABEL: return_zero: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 0{{$}} +; CHECK-NEXT: i32.const 0{{$}} ; CHECK-NEXT: end_function define i24 @return_zero() { ret i24 0 Index: test/CodeGen/WebAssembly/fast-isel-noreg.ll =================================================================== --- test/CodeGen/WebAssembly/fast-isel-noreg.ll +++ test/CodeGen/WebAssembly/fast-isel-noreg.ll @@ -6,14 +6,14 @@ target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" -; CHECK: i32.const $push0=, 0 +; CHECK: i32.const 0 define hidden i32 @a() #0 { entry: ret i32 zext (i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null) to i32) } -; CHECK: i32.const $push0=, 1 -; CHECK: br_if 0, $pop0 +; CHECK: i32.const 1 +; CHECK: br_if 0 define hidden i32 @b() #0 { entry: br i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null), label %a, label %b @@ -23,9 +23,9 @@ ret i32 0 } -; CHECK: i32.const $push1=, 0 -; CHECK: i32.const $push2=, 0 -; CHECK: i32.store 0($pop1), $pop2 +; CHECK: i32.const 0 +; CHECK: i32.const 0 +; CHECK: i32.store 0 define hidden i32 @c() #0 { entry: store i32 zext (i1 icmp eq (void (...)* inttoptr (i32 10 to void (...)*), void (...)* null) to i32), i32* inttoptr (i32 0 to i32 *) @@ -38,7 +38,7 @@ ; CHECK: i32.const {{.*}}, 24 ; CHECK: i32.shr_s ; CHECK: i32.const {{.*}}, 64 -; CHECK: br_if 0, $pop0 +; CHECK: br_if 0 define hidden i32 @d() #0 { entry: %t = icmp slt i8 ptrtoint (void ()* @addr to i8), 64 @@ -53,7 +53,7 @@ ; CHECK: i32.const {{.*}}, 255 ; CHECK: i32.and ; CHECK: i32.const {{.*}}, 64 -; CHECK: br_if 0, $pop0 +; CHECK: br_if 0 define hidden i32 @e() #0 { entry: %t = icmp ult i8 ptrtoint (void ()* @addr to i8), 64 Index: test/CodeGen/WebAssembly/fast-isel.ll =================================================================== --- test/CodeGen/WebAssembly/fast-isel.ll +++ test/CodeGen/WebAssembly/fast-isel.ll @@ -1,6 +1,5 @@ ; RUN: llc < %s -asm-verbose=false \ ; RUN: -fast-isel -fast-isel-abort=1 -verify-machineinstrs \ -; RUN: -disable-wasm-explicit-locals \ ; RUN: | FileCheck %s target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" @@ -9,40 +8,40 @@ ; This tests very minimal fast-isel functionality. ; CHECK-LABEL: immediate_f32: -; CHECK: f32.const $push{{[0-9]+}}=, 0x1.4p1{{$}} +; CHECK: f32.const 0x1.4p1{{$}} define float @immediate_f32() { ret float 2.5 } ; CHECK-LABEL: immediate_f64: -; CHECK: f64.const $push{{[0-9]+}}=, 0x1.4p1{{$}} +; CHECK: f64.const 0x1.4p1{{$}} define double @immediate_f64() { ret double 2.5 } ; CHECK-LABEL: bitcast_i32_f32: -; CHECK: i32.reinterpret/f32 $push{{[0-9]+}}=, $0{{$}} +; CHECK: i32.reinterpret/f32 define i32 @bitcast_i32_f32(float %x) { %y = bitcast float %x to i32 ret i32 %y } ; CHECK-LABEL: bitcast_f32_i32: -; CHECK: f32.reinterpret/i32 $push{{[0-9]+}}=, $0{{$}} +; CHECK: f32.reinterpret/i32 define float @bitcast_f32_i32(i32 %x) { %y = bitcast i32 %x to float ret float %y } ; CHECK-LABEL: bitcast_i64_f64: -; CHECK: i64.reinterpret/f64 $push{{[0-9]+}}=, $0{{$}} +; CHECK: i64.reinterpret/f64 define i64 @bitcast_i64_f64(double %x) { %y = bitcast double %x to i64 ret i64 %y } ; CHECK-LABEL: bitcast_f64_i64: -; CHECK: f64.reinterpret/i64 $push{{[0-9]+}}=, $0{{$}} +; CHECK: f64.reinterpret/i64 define double @bitcast_f64_i64(i64 %x) { %y = bitcast i64 %x to double ret double %y @@ -50,7 +49,7 @@ ; Do fold offsets into geps. ; CHECK-LABEL: do_fold_offset_into_gep: -; CHECK: i64.load $push{{[0-9]+}}=, 8($0) +; CHECK: i64.load 8 define i64 @do_fold_offset_into_gep(i64* %p) { bb: %tmp = getelementptr inbounds i64, i64* %p, i32 1 @@ -60,7 +59,7 @@ ; Don't fold negative offsets into geps. ; CHECK-LABEL: dont_fold_negative_offset: -; CHECK: i64.load $push{{[0-9]+}}=, 0($pop{{[0-9]+}}) +; CHECK: i64.load 0 define i64 @dont_fold_negative_offset(i64* %p) { bb: %tmp = getelementptr inbounds i64, i64* %p, i32 -1 @@ -70,7 +69,7 @@ ; Don't fold non-inbounds geps. ; CHECK-LABEL: dont_fold_non_inbounds_gep: -; CHECK: i64.load $push{{[0-9]+}}=, 0($pop{{[0-9]+}}) +; CHECK: i64.load 0 define i64 @dont_fold_non_inbounds_gep(i64* %p) { bb: %tmp = getelementptr i64, i64* %p, i32 1 Index: test/CodeGen/WebAssembly/frem.ll =================================================================== --- test/CodeGen/WebAssembly/frem.ll +++ test/CodeGen/WebAssembly/frem.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that the frem instruction works. @@ -8,8 +8,8 @@ ; CHECK-LABEL: frem32: ; CHECK-NEXT: .param f32, f32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: {{^}} f32.call $push0=, fmodf@FUNCTION, $0, $1{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: {{^}} f32.call fmodf@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define float @frem32(float %x, float %y) { %a = frem float %x, %y ret float %a @@ -18,8 +18,8 @@ ; CHECK-LABEL: frem64: ; CHECK-NEXT: .param f64, f64{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: {{^}} f64.call $push0=, fmod@FUNCTION, $0, $1{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: {{^}} f64.call fmod@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define double @frem64(double %x, double %y) { %a = frem double %x, %y ret double %a Index: test/CodeGen/WebAssembly/func.ll =================================================================== --- test/CodeGen/WebAssembly/func.ll +++ test/CodeGen/WebAssembly/func.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that basic functions assemble as expected. @@ -15,8 +15,8 @@ ; CHECK-LABEL: f1: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; CHECK: .size f1, define i32 @f1() { ret i32 0 @@ -25,8 +25,8 @@ ; CHECK-LABEL: f2: ; CHECK-NEXT: .param i32, f32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; CHECK: .size f2, define i32 @f2(i32 %p1, float %p2) { ret i32 0 Index: test/CodeGen/WebAssembly/function-bitcasts-varargs.ll =================================================================== --- test/CodeGen/WebAssembly/function-bitcasts-varargs.ll +++ test/CodeGen/WebAssembly/function-bitcasts-varargs.ll @@ -17,15 +17,15 @@ declare void @specified(i32, i32) ; CHECK: callWithArgs: -; CHECK: i32.const $push1=, 0 -; CHECK-NEXT: i32.const $push0=, 1 -; CHECK-NEXT: call .Lbitcast@FUNCTION, $pop1, $pop0 -; CHECK: call .Lbitcast.1@FUNCTION, $pop{{[0-9]+$}} +; CHECK: i32.const 0 +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: call .Lbitcast@FUNCTION +; CHECK: call .Lbitcast.1@FUNCTION ; CHECK: .Lbitcast: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK: call underspecified@FUNCTION, $pop{{[0-9]+$}} +; CHECK: call underspecified@FUNCTION ; CHECK: .Lbitcast.1: ; CHECK-NEXT: .param i32{{$}} -; CHECK: call specified@FUNCTION, $pop{{[0-9]+}}, $pop{{[0-9]+$}} +; CHECK: call specified@FUNCTION Index: test/CodeGen/WebAssembly/function-bitcasts.ll =================================================================== --- test/CodeGen/WebAssembly/function-bitcasts.ll +++ test/CodeGen/WebAssembly/function-bitcasts.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals -enable-emscripten-cxx-exceptions -wasm-temporary-workarounds=false | FileCheck %s +; RUN: llc < %s -asm-verbose=false -enable-emscripten-cxx-exceptions -wasm-temporary-workarounds=false | FileCheck %s ; Test that function pointer casts are replaced with wrappers. @@ -19,14 +19,14 @@ ; CHECK-NEXT: call .Lbitcast@FUNCTION{{$}} ; CHECK-NEXT: call .Lbitcast@FUNCTION{{$}} ; CHECK-NEXT: call .Lbitcast.1@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 0 -; CHECK-NEXT: call .Lbitcast.4@FUNCTION, $pop[[L0]]{{$}} -; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, 0 -; CHECK-NEXT: call .Lbitcast.4@FUNCTION, $pop[[L1]]{{$}} -; CHECK-NEXT: i32.const $push[[L2:[0-9]+]]=, 0 -; CHECK-NEXT: call .Lbitcast.4@FUNCTION, $pop[[L2]]{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: call .Lbitcast.4@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: call .Lbitcast.4@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: call .Lbitcast.4@FUNCTION{{$}} ; CHECK-NEXT: call foo0@FUNCTION -; CHECK-NEXT: i32.call $drop=, .Lbitcast.5@FUNCTION{{$}} +; CHECK-NEXT: i32.call .Lbitcast.5@FUNCTION{{$}} ; CHECK-NEXT: call foo2@FUNCTION{{$}} ; CHECK-NEXT: call foo1@FUNCTION{{$}} ; CHECK-NEXT: call foo3@FUNCTION{{$}} @@ -53,10 +53,10 @@ ; CHECK-LABEL: test_varargs: ; CHECK: set_global -; CHECK: i32.const $push[[L3:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: call .Lbitcast.2@FUNCTION, $pop[[L3]]{{$}} -; CHECK-NEXT: i32.const $push[[L4:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.store 0($[[L5:[0-9]+]]), $pop[[L4]]{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: call .Lbitcast.2@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.store 0($[[L5:[0-9]+]]){{$}} ; CHECK-NEXT: call .Lbitcast.3@FUNCTION, $[[L5]]{{$}} define void @test_varargs() { call void bitcast (void (...)* @vararg to void (i32)*)(i32 0) @@ -69,9 +69,9 @@ @global_func = hidden local_unnamed_addr global void ()* null ; CHECK-LABEL: test_store: -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, has_i32_ret@FUNCTION{{$}} -; CHECK-NEXT: i32.store global_func($pop[[L0]]), $pop[[L1]]{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.const has_i32_ret@FUNCTION{{$}} +; CHECK-NEXT: i32.store global_func{{$}} define void @test_store() { %1 = bitcast i32 ()* @has_i32_ret to void ()* store void ()* %1, void ()** @global_func @@ -80,9 +80,9 @@ ; CHECK-LABEL: test_load: ; CHECK-NEXT: result i32{{$}} -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.load $push[[L1:[0-9]+]]=, global_func($pop[[L0]]){{$}} -; CHECK-NEXT: i32.call_indirect $push{{[0-9]+}}=, $pop[[L1]]{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.load global_func{{$}} +; CHECK-NEXT: i32.call_indirect{{$}} define i32 @test_load() { %1 = load i32 ()*, i32 ()** bitcast (void ()** @global_func to i32 ()**) %2 = call i32 %1() @@ -94,10 +94,10 @@ declare void @call_func(i32 ()*) ; CHECK-LABEL: test_argument: -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, has_i32_ret@FUNCTION{{$}} -; CHECK-NEXT: call call_func@FUNCTION, $pop[[L0]]{{$}} -; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, has_i32_arg@FUNCTION{{$}} -; CHECK-NEXT: call call_func@FUNCTION, $pop[[L1]]{{$}} +; CHECK-NEXT: i32.const has_i32_ret@FUNCTION{{$}} +; CHECK-NEXT: call call_func@FUNCTION{{$}} +; CHECK-NEXT: i32.const has_i32_arg@FUNCTION{{$}} +; CHECK-NEXT: call call_func@FUNCTION{{$}} define void @test_argument() { call void @call_func(i32 ()* @has_i32_ret) call void @call_func(i32 ()* bitcast (void (i32)* @has_i32_arg to i32 ()*)) @@ -107,14 +107,14 @@ ; Invokes should be treated like calls ; CHECK-LABEL: test_invoke: -; CHECK: i32.const $push[[L1:[0-9]+]]=, call_func@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, has_i32_ret@FUNCTION{{$}} -; CHECK-NEXT: call "__invoke_void_i32()*"@FUNCTION, $pop[[L1]], $pop[[L0]]{{$}} -; CHECK: i32.const $push[[L3:[0-9]+]]=, call_func@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push[[L2:[0-9]+]]=, has_i32_arg@FUNCTION{{$}} -; CHECK-NEXT: call "__invoke_void_i32()*"@FUNCTION, $pop[[L3]], $pop[[L2]]{{$}} -; CHECK: i32.const $push[[L4:[0-9]+]]=, .Lbitcast@FUNCTION{{$}} -; CHECK-NEXT: call __invoke_void@FUNCTION, $pop[[L4]]{{$}} +; CHECK: i32.const call_func@FUNCTION{{$}} +; CHECK-NEXT: i32.const has_i32_ret@FUNCTION{{$}} +; CHECK-NEXT: call "__invoke_void_i32()*"@FUNCTION{{$}} +; CHECK: i32.const call_func@FUNCTION{{$}} +; CHECK-NEXT: i32.const has_i32_arg@FUNCTION{{$}} +; CHECK-NEXT: call "__invoke_void_i32()*"@FUNCTION{{$}} +; CHECK: i32.const .Lbitcast@FUNCTION{{$}} +; CHECK-NEXT: call __invoke_void@FUNCTION{{$}} declare i32 @personality(...) define void @test_invoke() personality i32 (...)* @personality { entry: @@ -139,19 +139,19 @@ } ; CHECK-LABEL: .Lbitcast: -; CHECK-NEXT: call has_i32_arg@FUNCTION, $0{{$}} +; CHECK-NEXT: call has_i32_arg@FUNCTION{{$}} ; CHECK-NEXT: end_function ; CHECK-LABEL: .Lbitcast.1: -; CHECK-NEXT: call $drop=, has_i32_ret@FUNCTION{{$}} +; CHECK-NEXT: call has_i32_ret@FUNCTION{{$}} ; CHECK-NEXT: end_function ; CHECK-LABEL: .Lbitcast.2: -; CHECK: call vararg@FUNCTION, $1{{$}} +; CHECK: call vararg@FUNCTION{{$}} ; CHECK: end_function ; CHECK-LABEL: .Lbitcast.3: -; CHECK: call plain@FUNCTION, $1{{$}} +; CHECK: call plain@FUNCTION{{$}} ; CHECK: end_function ; CHECK-LABEL: .Lbitcast.4: @@ -162,5 +162,5 @@ ; CHECK-LABEL: .Lbitcast.5: ; CHECK-NEXT: .result i32 ; CHECK-NEXT: call foo1@FUNCTION{{$}} -; CHECK-NEXT: copy_local $push0=, $0 +; CHECK-NEXT: copy_local $0 ; CHECK-NEXT: end_function Index: test/CodeGen/WebAssembly/global.ll =================================================================== --- test/CodeGen/WebAssembly/global.ll +++ test/CodeGen/WebAssembly/global.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that globals assemble as expected. @@ -10,9 +10,9 @@ @llvm.used = appending global [1 x i32*] [i32* @g], section "llvm.metadata" ; CHECK: foo: -; CHECK: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.load $push1=, answer($pop0){{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: i32.load answer{{$}} +; CHECK-NEXT: return{{$}} define i32 @foo() { %a = load i32, i32* @answer ret i32 %a @@ -21,8 +21,8 @@ ; CHECK-LABEL: call_memcpy: ; CHECK-NEXT: .param i32, i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.call $push0=, memcpy@FUNCTION, $0, $1, $2{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.call memcpy@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} declare void @llvm.memcpy.p0i8.p0i8.i32(i8* nocapture, i8* nocapture readonly, i32, i1) define i8* @call_memcpy(i8* %p, i8* nocapture readonly %q, i32 %n) { tail call void @llvm.memcpy.p0i8.p0i8.i32(i8* %p, i8* %q, i32 %n, i1 false) Index: test/CodeGen/WebAssembly/i32-load-store-alignment.ll =================================================================== --- test/CodeGen/WebAssembly/i32-load-store-alignment.ll +++ test/CodeGen/WebAssembly/i32-load-store-alignment.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mattr=+atomics -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -mattr=+atomics -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test loads and stores with custom alignment values. @@ -10,8 +10,8 @@ ; CHECK-LABEL: ldi32_a1: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($0):p2align=0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load 0:p2align=0{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32_a1(i32 *%p) { %v = load i32, i32* %p, align 1 ret i32 %v @@ -20,8 +20,8 @@ ; CHECK-LABEL: ldi32_a2: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($0):p2align=1{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load 0:p2align=1{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32_a2(i32 *%p) { %v = load i32, i32* %p, align 2 ret i32 %v @@ -32,8 +32,8 @@ ; CHECK-LABEL: ldi32_a4: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32_a4(i32 *%p) { %v = load i32, i32* %p, align 4 ret i32 %v @@ -44,8 +44,8 @@ ; CHECK-LABEL: ldi32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32(i32 *%p) { %v = load i32, i32* %p ret i32 %v @@ -56,8 +56,8 @@ ; CHECK-LABEL: ldi32_a8: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32_a8(i32 *%p) { %v = load i32, i32* %p, align 8 ret i32 %v @@ -68,8 +68,8 @@ ; CHECK-LABEL: ldi8_a1: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load8_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i8 @ldi8_a1(i8 *%p) { %v = load i8, i8* %p, align 1 ret i8 %v @@ -78,8 +78,8 @@ ; CHECK-LABEL: ldi8_a2: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load8_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i8 @ldi8_a2(i8 *%p) { %v = load i8, i8* %p, align 2 ret i8 %v @@ -88,8 +88,8 @@ ; CHECK-LABEL: ldi16_a1: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load16_u $push[[NUM:[0-9]+]]=, 0($0):p2align=0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load16_u 0:p2align=0{{$}} +; CHECK-NEXT: return{{$}} define i16 @ldi16_a1(i16 *%p) { %v = load i16, i16* %p, align 1 ret i16 %v @@ -98,8 +98,8 @@ ; CHECK-LABEL: ldi16_a2: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load16_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i16 @ldi16_a2(i16 *%p) { %v = load i16, i16* %p, align 2 ret i16 %v @@ -108,8 +108,8 @@ ; CHECK-LABEL: ldi16_a4: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load16_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i16 @ldi16_a4(i16 *%p) { %v = load i16, i16* %p, align 4 ret i16 %v @@ -119,7 +119,7 @@ ; CHECK-LABEL: sti32_a1: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store 0($0):p2align=0, $1{{$}} +; CHECK-NEXT: i32.store 0:p2align=0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a1(i32 *%p, i32 %v) { store i32 %v, i32* %p, align 1 @@ -128,7 +128,7 @@ ; CHECK-LABEL: sti32_a2: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store 0($0):p2align=1, $1{{$}} +; CHECK-NEXT: i32.store 0:p2align=1{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a2(i32 *%p, i32 %v) { store i32 %v, i32* %p, align 2 @@ -139,7 +139,7 @@ ; CHECK-LABEL: sti32_a4: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store 0($0), $1{{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a4(i32 *%p, i32 %v) { store i32 %v, i32* %p, align 4 @@ -150,7 +150,7 @@ ; CHECK-LABEL: sti32: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store 0($0), $1{{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32(i32 *%p, i32 %v) { store i32 %v, i32* %p @@ -159,7 +159,7 @@ ; CHECK-LABEL: sti32_a8: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store 0($0), $1{{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a8(i32 *%p, i32 %v) { store i32 %v, i32* %p, align 8 @@ -170,7 +170,7 @@ ; CHECK-LABEL: sti8_a1: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store8 0($0), $1{{$}} +; CHECK-NEXT: i32.store8 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti8_a1(i8 *%p, i8 %v) { store i8 %v, i8* %p, align 1 @@ -179,7 +179,7 @@ ; CHECK-LABEL: sti8_a2: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store8 0($0), $1{{$}} +; CHECK-NEXT: i32.store8 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti8_a2(i8 *%p, i8 %v) { store i8 %v, i8* %p, align 2 @@ -188,7 +188,7 @@ ; CHECK-LABEL: sti16_a1: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store16 0($0):p2align=0, $1{{$}} +; CHECK-NEXT: i32.store16 0:p2align=0{{$}} ; CHECK-NEXT: return{{$}} define void @sti16_a1(i16 *%p, i16 %v) { store i16 %v, i16* %p, align 1 @@ -197,7 +197,7 @@ ; CHECK-LABEL: sti16_a2: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store16 0($0), $1{{$}} +; CHECK-NEXT: i32.store16 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti16_a2(i16 *%p, i16 %v) { store i16 %v, i16* %p, align 2 @@ -206,7 +206,7 @@ ; CHECK-LABEL: sti16_a4: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.store16 0($0), $1{{$}} +; CHECK-NEXT: i32.store16 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti16_a4(i16 *%p, i16 %v) { store i16 %v, i16* %p, align 4 @@ -220,8 +220,8 @@ ; CHECK-LABEL: ldi32_atomic_a4: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.atomic.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.atomic.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32_atomic_a4(i32 *%p) { %v = load atomic i32, i32* %p seq_cst, align 4 ret i32 %v @@ -232,8 +232,8 @@ ; CHECK-LABEL: ldi32_atomic_a8: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.atomic.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.atomic.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32_atomic_a8(i32 *%p) { %v = load atomic i32, i32* %p seq_cst, align 8 ret i32 %v @@ -241,7 +241,7 @@ ; CHECK-LABEL: sti32_atomic_a4: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.atomic.store 0($0), $1{{$}} +; CHECK-NEXT: i32.atomic.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_atomic_a4(i32 *%p, i32 %v) { store atomic i32 %v, i32* %p seq_cst, align 4 @@ -250,7 +250,7 @@ ; CHECK-LABEL: sti32_atomic_a8: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.atomic.store 0($0), $1{{$}} +; CHECK-NEXT: i32.atomic.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_atomic_a8(i32 *%p, i32 %v) { store atomic i32 %v, i32* %p seq_cst, align 8 Index: test/CodeGen/WebAssembly/i32.ll =================================================================== --- test/CodeGen/WebAssembly/i32.ll +++ test/CodeGen/WebAssembly/i32.ll @@ -12,10 +12,10 @@ ; CHECK-LABEL: add32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.add $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: return{{$}} define i32 @add32(i32 %x, i32 %y) { %a = add i32 %x, %y ret i32 %a @@ -24,10 +24,10 @@ ; CHECK-LABEL: sub32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.sub $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.sub{{$}} +; CHECK-NEXT: return{{$}} define i32 @sub32(i32 %x, i32 %y) { %a = sub i32 %x, %y ret i32 %a @@ -36,10 +36,10 @@ ; CHECK-LABEL: mul32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.mul $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.mul{{$}} +; CHECK-NEXT: return{{$}} define i32 @mul32(i32 %x, i32 %y) { %a = mul i32 %x, %y ret i32 %a @@ -48,10 +48,10 @@ ; CHECK-LABEL: sdiv32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.div_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sdiv32(i32 %x, i32 %y) { %a = sdiv i32 %x, %y ret i32 %a @@ -60,10 +60,10 @@ ; CHECK-LABEL: udiv32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.div_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.div_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @udiv32(i32 %x, i32 %y) { %a = udiv i32 %x, %y ret i32 %a @@ -72,10 +72,10 @@ ; CHECK-LABEL: srem32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.rem_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.rem_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @srem32(i32 %x, i32 %y) { %a = srem i32 %x, %y ret i32 %a @@ -84,10 +84,10 @@ ; CHECK-LABEL: urem32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.rem_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.rem_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @urem32(i32 %x, i32 %y) { %a = urem i32 %x, %y ret i32 %a @@ -96,10 +96,10 @@ ; CHECK-LABEL: and32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.and $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: return{{$}} define i32 @and32(i32 %x, i32 %y) { %a = and i32 %x, %y ret i32 %a @@ -108,10 +108,10 @@ ; CHECK-LABEL: or32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.or $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.or{{$}} +; CHECK-NEXT: return{{$}} define i32 @or32(i32 %x, i32 %y) { %a = or i32 %x, %y ret i32 %a @@ -120,10 +120,10 @@ ; CHECK-LABEL: xor32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.xor $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: return{{$}} define i32 @xor32(i32 %x, i32 %y) { %a = xor i32 %x, %y ret i32 %a @@ -132,10 +132,10 @@ ; CHECK-LABEL: shl32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.shl $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.shl{{$}} +; CHECK-NEXT: return{{$}} define i32 @shl32(i32 %x, i32 %y) { %a = shl i32 %x, %y ret i32 %a @@ -144,10 +144,10 @@ ; CHECK-LABEL: shr32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.shr_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.shr_u{{$}} +; CHECK-NEXT: return{{$}} define i32 @shr32(i32 %x, i32 %y) { %a = lshr i32 %x, %y ret i32 %a @@ -156,10 +156,10 @@ ; CHECK-LABEL: sar32: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.shr_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.shr_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sar32(i32 %x, i32 %y) { %a = ashr i32 %x, %y ret i32 %a @@ -168,9 +168,9 @@ ; CHECK-LABEL: clz32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.clz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.clz{{$}} +; CHECK-NEXT: return{{$}} define i32 @clz32(i32 %x) { %a = call i32 @llvm.ctlz.i32(i32 %x, i1 false) ret i32 %a @@ -179,9 +179,9 @@ ; CHECK-LABEL: clz32_zero_undef: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.clz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.clz{{$}} +; CHECK-NEXT: return{{$}} define i32 @clz32_zero_undef(i32 %x) { %a = call i32 @llvm.ctlz.i32(i32 %x, i1 true) ret i32 %a @@ -190,9 +190,9 @@ ; CHECK-LABEL: ctz32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.ctz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.ctz{{$}} +; CHECK-NEXT: return{{$}} define i32 @ctz32(i32 %x) { %a = call i32 @llvm.cttz.i32(i32 %x, i1 false) ret i32 %a @@ -201,9 +201,9 @@ ; CHECK-LABEL: ctz32_zero_undef: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.ctz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.ctz{{$}} +; CHECK-NEXT: return{{$}} define i32 @ctz32_zero_undef(i32 %x) { %a = call i32 @llvm.cttz.i32(i32 %x, i1 true) ret i32 %a @@ -212,9 +212,9 @@ ; CHECK-LABEL: popcnt32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.popcnt $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.popcnt{{$}} +; CHECK-NEXT: return{{$}} define i32 @popcnt32(i32 %x) { %a = call i32 @llvm.ctpop.i32(i32 %x) ret i32 %a @@ -223,9 +223,9 @@ ; CHECK-LABEL: eqz32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.eqz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.eqz{{$}} +; CHECK-NEXT: return{{$}} define i32 @eqz32(i32 %x) { %a = icmp eq i32 %x, 0 %b = zext i1 %a to i32 @@ -235,10 +235,10 @@ ; CHECK-LABEL: rotl: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.rotl $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.rotl +; CHECK-NEXT: return{{$}} define i32 @rotl(i32 %x, i32 %y) { %z = sub i32 32, %y %b = shl i32 %x, %y @@ -250,10 +250,10 @@ ; CHECK-LABEL: masked_rotl: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.rotl $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.rotl +; CHECK-NEXT: return{{$}} define i32 @masked_rotl(i32 %x, i32 %y) { %a = and i32 %y, 31 %z = sub i32 32, %a @@ -266,10 +266,10 @@ ; CHECK-LABEL: rotr: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.rotr $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.rotr +; CHECK-NEXT: return{{$}} define i32 @rotr(i32 %x, i32 %y) { %z = sub i32 32, %y %b = lshr i32 %x, %y @@ -281,10 +281,10 @@ ; CHECK-LABEL: masked_rotr: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.rotr $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.rotr +; CHECK-NEXT: return{{$}} define i32 @masked_rotr(i32 %x, i32 %y) { %a = and i32 %y, 31 %z = sub i32 32, %a Index: test/CodeGen/WebAssembly/i64-load-store-alignment.ll =================================================================== --- test/CodeGen/WebAssembly/i64-load-store-alignment.ll +++ test/CodeGen/WebAssembly/i64-load-store-alignment.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mattr=+atomics -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -mattr=+atomics -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test loads and stores with custom alignment values. @@ -10,8 +10,8 @@ ; CHECK-LABEL: ldi64_a1: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($0):p2align=0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load 0:p2align=0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64_a1(i64 *%p) { %v = load i64, i64* %p, align 1 ret i64 %v @@ -20,8 +20,8 @@ ; CHECK-LABEL: ldi64_a2: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($0):p2align=1{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load 0:p2align=1{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64_a2(i64 *%p) { %v = load i64, i64* %p, align 2 ret i64 %v @@ -30,8 +30,8 @@ ; CHECK-LABEL: ldi64_a4: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($0):p2align=2{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load 0:p2align=2{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64_a4(i64 *%p) { %v = load i64, i64* %p, align 4 ret i64 %v @@ -42,8 +42,8 @@ ; CHECK-LABEL: ldi64_a8: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64_a8(i64 *%p) { %v = load i64, i64* %p, align 8 ret i64 %v @@ -54,8 +54,8 @@ ; CHECK-LABEL: ldi64: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64(i64 *%p) { %v = load i64, i64* %p ret i64 %v @@ -66,8 +66,8 @@ ; CHECK-LABEL: ldi64_a16: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64_a16(i64 *%p) { %v = load i64, i64* %p, align 16 ret i64 %v @@ -78,8 +78,8 @@ ; CHECK-LABEL: ldi8_a1: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load8_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi8_a1(i8 *%p) { %v = load i8, i8* %p, align 1 %w = zext i8 %v to i64 @@ -89,8 +89,8 @@ ; CHECK-LABEL: ldi8_a2: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load8_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi8_a2(i8 *%p) { %v = load i8, i8* %p, align 2 %w = zext i8 %v to i64 @@ -100,8 +100,8 @@ ; CHECK-LABEL: ldi16_a1: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load16_u $push[[NUM:[0-9]+]]=, 0($0):p2align=0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load16_u 0:p2align=0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi16_a1(i16 *%p) { %v = load i16, i16* %p, align 1 %w = zext i16 %v to i64 @@ -111,8 +111,8 @@ ; CHECK-LABEL: ldi16_a2: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load16_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi16_a2(i16 *%p) { %v = load i16, i16* %p, align 2 %w = zext i16 %v to i64 @@ -122,8 +122,8 @@ ; CHECK-LABEL: ldi16_a4: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load16_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi16_a4(i16 *%p) { %v = load i16, i16* %p, align 4 %w = zext i16 %v to i64 @@ -133,8 +133,8 @@ ; CHECK-LABEL: ldi32_a1: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load32_u $push[[NUM:[0-9]+]]=, 0($0):p2align=0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load32_u 0:p2align=0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi32_a1(i32 *%p) { %v = load i32, i32* %p, align 1 %w = zext i32 %v to i64 @@ -144,8 +144,8 @@ ; CHECK-LABEL: ldi32_a2: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load32_u $push[[NUM:[0-9]+]]=, 0($0):p2align=1{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load32_u 0:p2align=1{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi32_a2(i32 *%p) { %v = load i32, i32* %p, align 2 %w = zext i32 %v to i64 @@ -155,8 +155,8 @@ ; CHECK-LABEL: ldi32_a4: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load32_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load32_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi32_a4(i32 *%p) { %v = load i32, i32* %p, align 4 %w = zext i32 %v to i64 @@ -166,8 +166,8 @@ ; CHECK-LABEL: ldi32_a8: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.load32_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.load32_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi32_a8(i32 *%p) { %v = load i32, i32* %p, align 8 %w = zext i32 %v to i64 @@ -178,7 +178,7 @@ ; CHECK-LABEL: sti64_a1: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store 0($0):p2align=0, $1{{$}} +; CHECK-NEXT: i64.store 0:p2align=0{{$}} ; CHECK-NEXT: return{{$}} define void @sti64_a1(i64 *%p, i64 %v) { store i64 %v, i64* %p, align 1 @@ -187,7 +187,7 @@ ; CHECK-LABEL: sti64_a2: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store 0($0):p2align=1, $1{{$}} +; CHECK-NEXT: i64.store 0:p2align=1{{$}} ; CHECK-NEXT: return{{$}} define void @sti64_a2(i64 *%p, i64 %v) { store i64 %v, i64* %p, align 2 @@ -196,7 +196,7 @@ ; CHECK-LABEL: sti64_a4: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store 0($0):p2align=2, $1{{$}} +; CHECK-NEXT: i64.store 0:p2align=2{{$}} ; CHECK-NEXT: return{{$}} define void @sti64_a4(i64 *%p, i64 %v) { store i64 %v, i64* %p, align 4 @@ -207,7 +207,7 @@ ; CHECK-LABEL: sti64_a8: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store 0($0), $1{{$}} +; CHECK-NEXT: i64.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti64_a8(i64 *%p, i64 %v) { store i64 %v, i64* %p, align 8 @@ -218,7 +218,7 @@ ; CHECK-LABEL: sti64: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store 0($0), $1{{$}} +; CHECK-NEXT: i64.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti64(i64 *%p, i64 %v) { store i64 %v, i64* %p @@ -227,7 +227,7 @@ ; CHECK-LABEL: sti64_a16: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store 0($0), $1{{$}} +; CHECK-NEXT: i64.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti64_a16(i64 *%p, i64 %v) { store i64 %v, i64* %p, align 16 @@ -238,7 +238,7 @@ ; CHECK-LABEL: sti8_a1: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store8 0($0), $1{{$}} +; CHECK-NEXT: i64.store8 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti8_a1(i8 *%p, i64 %w) { %v = trunc i64 %w to i8 @@ -248,7 +248,7 @@ ; CHECK-LABEL: sti8_a2: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store8 0($0), $1{{$}} +; CHECK-NEXT: i64.store8 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti8_a2(i8 *%p, i64 %w) { %v = trunc i64 %w to i8 @@ -258,7 +258,7 @@ ; CHECK-LABEL: sti16_a1: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store16 0($0):p2align=0, $1{{$}} +; CHECK-NEXT: i64.store16 0:p2align=0{{$}} ; CHECK-NEXT: return{{$}} define void @sti16_a1(i16 *%p, i64 %w) { %v = trunc i64 %w to i16 @@ -268,7 +268,7 @@ ; CHECK-LABEL: sti16_a2: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store16 0($0), $1{{$}} +; CHECK-NEXT: i64.store16 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti16_a2(i16 *%p, i64 %w) { %v = trunc i64 %w to i16 @@ -278,7 +278,7 @@ ; CHECK-LABEL: sti16_a4: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store16 0($0), $1{{$}} +; CHECK-NEXT: i64.store16 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti16_a4(i16 *%p, i64 %w) { %v = trunc i64 %w to i16 @@ -288,7 +288,7 @@ ; CHECK-LABEL: sti32_a1: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store32 0($0):p2align=0, $1{{$}} +; CHECK-NEXT: i64.store32 0:p2align=0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a1(i32 *%p, i64 %w) { %v = trunc i64 %w to i32 @@ -298,7 +298,7 @@ ; CHECK-LABEL: sti32_a2: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store32 0($0):p2align=1, $1{{$}} +; CHECK-NEXT: i64.store32 0:p2align=1{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a2(i32 *%p, i64 %w) { %v = trunc i64 %w to i32 @@ -308,7 +308,7 @@ ; CHECK-LABEL: sti32_a4: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store32 0($0), $1{{$}} +; CHECK-NEXT: i64.store32 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a4(i32 *%p, i64 %w) { %v = trunc i64 %w to i32 @@ -318,7 +318,7 @@ ; CHECK-LABEL: sti32_a8: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.store32 0($0), $1{{$}} +; CHECK-NEXT: i64.store32 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32_a8(i32 *%p, i64 %w) { %v = trunc i64 %w to i32 @@ -333,8 +333,8 @@ ; CHECK-LABEL: ldi64_atomic_a8: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.atomic.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.atomic.load 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64_atomic_a8(i64 *%p) { %v = load atomic i64, i64* %p seq_cst, align 8 ret i64 %v @@ -344,8 +344,8 @@ ; CHECK-LABEL: ldi64_atomic_a16: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.atomic.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.atomic.load 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64_atomic_a16(i64 *%p) { %v = load atomic i64, i64* %p seq_cst, align 16 ret i64 %v @@ -353,7 +353,7 @@ ; CHECK-LABEL: sti64_atomic_a4: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.atomic.store 0($0), $1{{$}} +; CHECK-NEXT: i64.atomic.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti64_atomic_a4(i64 *%p, i64 %v) { store atomic i64 %v, i64* %p seq_cst, align 8 @@ -363,7 +363,7 @@ ; 16 is greater than the default alignment so it is ignored. ; CHECK-LABEL: sti64_atomic_a8: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.atomic.store 0($0), $1{{$}} +; CHECK-NEXT: i64.atomic.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti64_atomic_a8(i64 *%p, i64 %v) { store atomic i64 %v, i64* %p seq_cst, align 16 Index: test/CodeGen/WebAssembly/i64.ll =================================================================== --- test/CodeGen/WebAssembly/i64.ll +++ test/CodeGen/WebAssembly/i64.ll @@ -12,10 +12,10 @@ ; CHECK-LABEL: add64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.add $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.add {{$}} +; CHECK-NEXT: return{{$}} define i64 @add64(i64 %x, i64 %y) { %a = add i64 %x, %y ret i64 %a @@ -24,10 +24,10 @@ ; CHECK-LABEL: sub64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.sub $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.sub{{$}} +; CHECK-NEXT: return{{$}} define i64 @sub64(i64 %x, i64 %y) { %a = sub i64 %x, %y ret i64 %a @@ -36,10 +36,10 @@ ; CHECK-LABEL: mul64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.mul $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.mul{{$}} +; CHECK-NEXT: return{{$}} define i64 @mul64(i64 %x, i64 %y) { %a = mul i64 %x, %y ret i64 %a @@ -48,10 +48,10 @@ ; CHECK-LABEL: sdiv64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.div_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.div_s{{$}} +; CHECK-NEXT: return{{$}} define i64 @sdiv64(i64 %x, i64 %y) { %a = sdiv i64 %x, %y ret i64 %a @@ -60,10 +60,10 @@ ; CHECK-LABEL: udiv64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.div_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.div_u{{$}} +; CHECK-NEXT: return{{$}} define i64 @udiv64(i64 %x, i64 %y) { %a = udiv i64 %x, %y ret i64 %a @@ -72,10 +72,10 @@ ; CHECK-LABEL: srem64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.rem_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.rem_s{{$}} +; CHECK-NEXT: return{{$}} define i64 @srem64(i64 %x, i64 %y) { %a = srem i64 %x, %y ret i64 %a @@ -84,10 +84,10 @@ ; CHECK-LABEL: urem64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.rem_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.rem_u{{$}} +; CHECK-NEXT: return{{$}} define i64 @urem64(i64 %x, i64 %y) { %a = urem i64 %x, %y ret i64 %a @@ -96,10 +96,10 @@ ; CHECK-LABEL: and64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.and $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.and{{$}} +; CHECK-NEXT: return{{$}} define i64 @and64(i64 %x, i64 %y) { %a = and i64 %x, %y ret i64 %a @@ -108,10 +108,10 @@ ; CHECK-LABEL: or64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.or $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.or{{$}} +; CHECK-NEXT: return{{$}} define i64 @or64(i64 %x, i64 %y) { %a = or i64 %x, %y ret i64 %a @@ -120,10 +120,10 @@ ; CHECK-LABEL: xor64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.xor $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.xor{{$}} +; CHECK-NEXT: return{{$}} define i64 @xor64(i64 %x, i64 %y) { %a = xor i64 %x, %y ret i64 %a @@ -132,10 +132,10 @@ ; CHECK-LABEL: shl64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.shl $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.shl{{$}} +; CHECK-NEXT: return{{$}} define i64 @shl64(i64 %x, i64 %y) { %a = shl i64 %x, %y ret i64 %a @@ -144,10 +144,10 @@ ; CHECK-LABEL: shr64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.shr_u $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.shr_u{{$}} +; CHECK-NEXT: return{{$}} define i64 @shr64(i64 %x, i64 %y) { %a = lshr i64 %x, %y ret i64 %a @@ -156,10 +156,10 @@ ; CHECK-LABEL: sar64: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.shr_s $push0=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.shr_s{{$}} +; CHECK-NEXT: return{{$}} define i64 @sar64(i64 %x, i64 %y) { %a = ashr i64 %x, %y ret i64 %a @@ -168,9 +168,9 @@ ; CHECK-LABEL: clz64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.clz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i64.clz{{$}} +; CHECK-NEXT: return{{$}} define i64 @clz64(i64 %x) { %a = call i64 @llvm.ctlz.i64(i64 %x, i1 false) ret i64 %a @@ -179,9 +179,9 @@ ; CHECK-LABEL: clz64_zero_undef: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.clz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i64.clz{{$}} +; CHECK-NEXT: return{{$}} define i64 @clz64_zero_undef(i64 %x) { %a = call i64 @llvm.ctlz.i64(i64 %x, i1 true) ret i64 %a @@ -190,9 +190,9 @@ ; CHECK-LABEL: ctz64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.ctz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i64.ctz{{$}} +; CHECK-NEXT: return{{$}} define i64 @ctz64(i64 %x) { %a = call i64 @llvm.cttz.i64(i64 %x, i1 false) ret i64 %a @@ -201,9 +201,9 @@ ; CHECK-LABEL: ctz64_zero_undef: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.ctz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i64.ctz{{$}} +; CHECK-NEXT: return{{$}} define i64 @ctz64_zero_undef(i64 %x) { %a = call i64 @llvm.cttz.i64(i64 %x, i1 true) ret i64 %a @@ -212,9 +212,9 @@ ; CHECK-LABEL: popcnt64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.popcnt $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i64.popcnt{{$}} +; CHECK-NEXT: return{{$}} define i64 @popcnt64(i64 %x) { %a = call i64 @llvm.ctpop.i64(i64 %x) ret i64 %a @@ -223,9 +223,9 @@ ; CHECK-LABEL: eqz64: ; CHECK-NEXT: .param i64{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.eqz $push0=, $pop[[L0]]{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i64.eqz{{$}} +; CHECK-NEXT: return{{$}} define i32 @eqz64(i64 %x) { %a = icmp eq i64 %x, 0 %b = zext i1 %a to i32 @@ -235,10 +235,10 @@ ; CHECK-LABEL: rotl: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.rotl $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.rotl +; CHECK-NEXT: return{{$}} define i64 @rotl(i64 %x, i64 %y) { %z = sub i64 64, %y %b = shl i64 %x, %y @@ -250,10 +250,10 @@ ; CHECK-LABEL: masked_rotl: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.rotl $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.rotl +; CHECK-NEXT: return{{$}} define i64 @masked_rotl(i64 %x, i64 %y) { %a = and i64 %y, 63 %z = sub i64 64, %a @@ -266,10 +266,10 @@ ; CHECK-LABEL: rotr: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.rotr $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.rotr +; CHECK-NEXT: return{{$}} define i64 @rotr(i64 %x, i64 %y) { %z = sub i64 64, %y %b = lshr i64 %x, %y @@ -281,10 +281,10 @@ ; CHECK-LABEL: masked_rotr: ; CHECK-NEXT: .param i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.rotr $push0=, $pop[[L0]], $pop[[L1]] -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.rotr +; CHECK-NEXT: return{{$}} define i64 @masked_rotr(i64 %x, i64 %y) { %a = and i64 %y, 63 %z = sub i64 64, %a Index: test/CodeGen/WebAssembly/immediates.ll =================================================================== --- test/CodeGen/WebAssembly/immediates.ll +++ test/CodeGen/WebAssembly/immediates.ll @@ -7,136 +7,136 @@ ; CHECK-LABEL: zero_i32: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @zero_i32() { ret i32 0 } ; CHECK-LABEL: one_i32: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: return{{$}} define i32 @one_i32() { ret i32 1 } ; CHECK-LABEL: max_i32: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, 2147483647{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.const 2147483647{{$}} +; CHECK-NEXT: return{{$}} define i32 @max_i32() { ret i32 2147483647 } ; CHECK-LABEL: min_i32: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM:[0-9]+]]=, -2147483648{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.const -2147483648{{$}} +; CHECK-NEXT: return{{$}} define i32 @min_i32() { ret i32 -2147483648 } ; CHECK-LABEL: zero_i64: ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.const $push[[NUM:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.const 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @zero_i64() { ret i64 0 } ; CHECK-LABEL: one_i64: ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.const $push[[NUM:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.const 1{{$}} +; CHECK-NEXT: return{{$}} define i64 @one_i64() { ret i64 1 } ; CHECK-LABEL: max_i64: ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.const $push[[NUM:[0-9]+]]=, 9223372036854775807{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.const 9223372036854775807{{$}} +; CHECK-NEXT: return{{$}} define i64 @max_i64() { ret i64 9223372036854775807 } ; CHECK-LABEL: min_i64: ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.const $push[[NUM:[0-9]+]]=, -9223372036854775808{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.const -9223372036854775808{{$}} +; CHECK-NEXT: return{{$}} define i64 @min_i64() { ret i64 -9223372036854775808 } ; CHECK-LABEL: negzero_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, -0x0p0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const -0x0p0{{$}} +; CHECK-NEXT: return{{$}} define float @negzero_f32() { ret float -0.0 } ; CHECK-LABEL: zero_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, 0x0p0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const 0x0p0{{$}} +; CHECK-NEXT: return{{$}} define float @zero_f32() { ret float 0.0 } ; CHECK-LABEL: one_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, 0x1p0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const 0x1p0{{$}} +; CHECK-NEXT: return{{$}} define float @one_f32() { ret float 1.0 } ; CHECK-LABEL: two_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, 0x1p1{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const 0x1p1{{$}} +; CHECK-NEXT: return{{$}} define float @two_f32() { ret float 2.0 } ; CHECK-LABEL: nan_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, nan{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const nan{{$}} +; CHECK-NEXT: return{{$}} define float @nan_f32() { ret float 0x7FF8000000000000 } ; CHECK-LABEL: negnan_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, -nan{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const -nan{{$}} +; CHECK-NEXT: return{{$}} define float @negnan_f32() { ret float 0xFFF8000000000000 } ; CHECK-LABEL: inf_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, infinity{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const infinity{{$}} +; CHECK-NEXT: return{{$}} define float @inf_f32() { ret float 0x7FF0000000000000 } ; CHECK-LABEL: neginf_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, -infinity{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const -infinity{{$}} +; CHECK-NEXT: return{{$}} define float @neginf_f32() { ret float 0xFFF0000000000000 } ; CHECK-LABEL: custom_nan_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, -nan:0x6bcdef{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const -nan:0x6bcdef{{$}} +; CHECK-NEXT: return{{$}} define float @custom_nan_f32() { ret float 0xFFFD79BDE0000000 } @@ -146,88 +146,88 @@ ; CHECK-LABEL: custom_nans_f32: ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.const $push[[NUM:[0-9]+]]=, -nan:0x6bcdef{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f32.const -nan:0x6bcdef{{$}} +; CHECK-NEXT: return{{$}} define float @custom_nans_f32() { ret float 0xFFF579BDE0000000 } ; CHECK-LABEL: negzero_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, -0x0p0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const -0x0p0{{$}} +; CHECK-NEXT: return{{$}} define double @negzero_f64() { ret double -0.0 } ; CHECK-LABEL: zero_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, 0x0p0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const 0x0p0{{$}} +; CHECK-NEXT: return{{$}} define double @zero_f64() { ret double 0.0 } ; CHECK-LABEL: one_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, 0x1p0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const 0x1p0{{$}} +; CHECK-NEXT: return{{$}} define double @one_f64() { ret double 1.0 } ; CHECK-LABEL: two_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, 0x1p1{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const 0x1p1{{$}} +; CHECK-NEXT: return{{$}} define double @two_f64() { ret double 2.0 } ; CHECK-LABEL: nan_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, nan{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const nan{{$}} +; CHECK-NEXT: return{{$}} define double @nan_f64() { ret double 0x7FF8000000000000 } ; CHECK-LABEL: negnan_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, -nan{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const -nan{{$}} +; CHECK-NEXT: return{{$}} define double @negnan_f64() { ret double 0xFFF8000000000000 } ; CHECK-LABEL: inf_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, infinity{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const infinity{{$}} +; CHECK-NEXT: return{{$}} define double @inf_f64() { ret double 0x7FF0000000000000 } ; CHECK-LABEL: neginf_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, -infinity{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const -infinity{{$}} +; CHECK-NEXT: return{{$}} define double @neginf_f64() { ret double 0xFFF0000000000000 } ; CHECK-LABEL: custom_nan_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, -nan:0xabcdef0123456{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const -nan:0xabcdef0123456{{$}} +; CHECK-NEXT: return{{$}} define double @custom_nan_f64() { ret double 0xFFFABCDEF0123456 } ; CHECK-LABEL: custom_nans_f64: ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.const $push[[NUM:[0-9]+]]=, -nan:0x2bcdef0123456{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: f64.const -nan:0x2bcdef0123456{{$}} +; CHECK-NEXT: return{{$}} define double @custom_nans_f64() { ret double 0xFFF2BCDEF0123456 } Index: test/CodeGen/WebAssembly/implicit-def.ll =================================================================== --- test/CodeGen/WebAssembly/implicit-def.ll +++ test/CodeGen/WebAssembly/implicit-def.ll @@ -6,8 +6,8 @@ ; CONST_I32 to provide an explicit push. ; CHECK: br_if 2, -; CHECK: i32.const $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: return $pop[[L0]]{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} define i1 @f() { %a = xor i1 0, 0 switch i1 %a, label %C [ Index: test/CodeGen/WebAssembly/indirect-import.ll =================================================================== --- test/CodeGen/WebAssembly/indirect-import.ll +++ test/CodeGen/WebAssembly/indirect-import.ll @@ -19,25 +19,25 @@ %vs = alloca void (%struct.big*)*, align 4 %s = alloca void (%struct.big*)*, align 4 -; CHECK-DAG: i32.const {{.+}}=, extern_fd@FUNCTION -; CHECK-DAG: i32.const {{.+}}=, extern_vj@FUNCTION +; CHECK-DAG: i32.const extern_fd@FUNCTION +; CHECK-DAG: i32.const extern_vj@FUNCTION store float (double)* @extern_fd, float (double)** %fd, align 4 store void (i64)* @extern_vj, void (i64)** %vj, align 4 %0 = load void (i64)*, void (i64)** %vj, align 4 call void %0(i64 1) -; CHECK: i32.const {{.+}}=, extern_v@FUNCTION +; CHECK: i32.const extern_v@FUNCTION store void ()* @extern_v, void ()** %v, align 4 %1 = load void ()*, void ()** %v, align 4 call void %1() -; CHECK: i32.const {{.+}}=, extern_ijidf@FUNCTION +; CHECK: i32.const extern_ijidf@FUNCTION store i32 (i64, i32, double, float)* @extern_ijidf, i32 (i64, i32, double, float)** %ijidf, align 4 %2 = load i32 (i64, i32, double, float)*, i32 (i64, i32, double, float)** %ijidf, align 4 %call = call i32 %2(i64 1, i32 2, double 3.000000e+00, float 4.000000e+00) -; CHECK-DAG: i32.const {{.+}}=, extern_struct@FUNCTION -; CHECK-DAG: i32.const {{.+}}=, extern_sret@FUNCTION +; CHECK-DAG: i32.const extern_struct@FUNCTION +; CHECK-DAG: i32.const extern_sret@FUNCTION store void (%struct.big*)* @extern_struct, void (%struct.big*)** %vs, align 4 store void (%struct.big*)* @extern_sret, void (%struct.big*)** %s, align 4 %3 = load float (double)*, float (double)** %fd, align 4 Index: test/CodeGen/WebAssembly/inline-asm-m.ll =================================================================== --- test/CodeGen/WebAssembly/inline-asm-m.ll +++ test/CodeGen/WebAssembly/inline-asm-m.ll @@ -1,4 +1,4 @@ -; RUN: not llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -no-integrated-as +; RUN: not llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -no-integrated-as ; Test basic inline assembly "m" operands, which are unsupported. Pass ; -no-integrated-as since these aren't actually valid assembly syntax. Index: test/CodeGen/WebAssembly/inline-asm.ll =================================================================== --- test/CodeGen/WebAssembly/inline-asm.ll +++ test/CodeGen/WebAssembly/inline-asm.ll @@ -12,8 +12,8 @@ ; CHECK-NEXT: #APP{{$}} ; CHECK-NEXT: # 0 = aaa(0){{$}} ; CHECK-NEXT: #NO_APP{{$}} -; CHECK-NEXT: get_local $push0=, 0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @foo(i32 %r) { entry: %0 = tail call i32 asm sideeffect "# $0 = aaa($1)", "=r,r"(i32 %r) #0, !srcloc !0 @@ -26,8 +26,8 @@ ; CHECK-NEXT: #APP{{$}} ; CHECK-NEXT: # 0 = ccc(42){{$}} ; CHECK-NEXT: #NO_APP{{$}} -; CHECK-NEXT: get_local $push0=, 0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @imm() { entry: %0 = tail call i32 asm sideeffect "# $0 = ccc($1)", "=r,i"(i32 42) #0, !srcloc !2 @@ -40,8 +40,8 @@ ; CHECK-NEXT: #APP{{$}} ; CHECK-NEXT: # 0 = aaa(0){{$}} ; CHECK-NEXT: #NO_APP{{$}} -; CHECK-NEXT: get_local $push0=, 0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @foo_i64(i64 %r) { entry: %0 = tail call i64 asm sideeffect "# $0 = aaa($1)", "=r,r"(i64 %r) #0, !srcloc !0 @@ -50,9 +50,9 @@ ; CHECK-LABEL: X_i16: ; CHECK: foo 1{{$}} -; CHECK: get_local $push[[S0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[S1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.store16 0($pop[[S0]]), $pop[[S1]]{{$}} +; CHECK: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.store16 0{{$}} define void @X_i16(i16 * %t) { call void asm sideeffect "foo $0", "=*X,~{dirflag},~{fpsr},~{flags},~{memory}"(i16* %t) ret void @@ -60,9 +60,9 @@ ; CHECK-LABEL: X_ptr: ; CHECK: foo 1{{$}} -; CHECK: get_local $push[[S0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[S1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.store 0($pop[[S0]]), $pop[[S1]]{{$}} +; CHECK: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.store 0{{$}} define void @X_ptr(i16 ** %t) { call void asm sideeffect "foo $0", "=*X,~{dirflag},~{fpsr},~{flags},~{memory}"(i16** %t) ret void @@ -84,12 +84,12 @@ } ; CHECK-LABEL: r_constraint -; CHECK: i32.const $push[[S0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: set_local [[L0:[0-9]+]], $pop[[S0]]{{$}} -; CHECK-NEXT: i32.const $push[[S1:[0-9]+]]=, 37{{$}} -; CHECK-NEXT: set_local [[L1:[0-9]+]], $pop[[S1]]{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: set_local [[L0:[0-9]+]]{{$}} +; CHECK-NEXT: i32.const 37{{$}} +; CHECK-NEXT: set_local [[L1:[0-9]+]]{{$}} ; CHECK: foo [[L2:[0-9]+]], 1, [[L0]], [[L1]]{{$}} -; CHECK: get_local $push{{[0-9]+}}=, [[L2]]{{$}} +; CHECK: get_local [[L2]]{{$}} define hidden i32 @r_constraint(i32 %a, i32 %y) { entry: %z = bitcast i32 0 to i32 Index: test/CodeGen/WebAssembly/irreducible-cfg.ll =================================================================== --- test/CodeGen/WebAssembly/irreducible-cfg.ll +++ test/CodeGen/WebAssembly/irreducible-cfg.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-block-placement -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -verify-machineinstrs -disable-block-placement | FileCheck %s ; Test irreducible CFG handling. Index: test/CodeGen/WebAssembly/legalize.ll =================================================================== --- test/CodeGen/WebAssembly/legalize.ll +++ test/CodeGen/WebAssembly/legalize.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test various types and operators that need to be legalized. @@ -6,18 +6,18 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: shl_i3: -; CHECK: i32.const $push0=, 7{{$}} -; CHECK: i32.and $push1=, $1, $pop0{{$}} -; CHECK: i32.shl $push2=, $0, $pop1{{$}} +; CHECK: i32.const 7{{$}} +; CHECK: i32.and +; CHECK: i32.shl define i3 @shl_i3(i3 %a, i3 %b, i3* %p) { %t = shl i3 %a, %b ret i3 %t } ; CHECK-LABEL: shl_i53: -; CHECK: i64.const $push0=, 9007199254740991{{$}} -; CHECK: i64.and $push1=, $1, $pop0{{$}} -; CHECK: i64.shl $push2=, $0, $pop1{{$}} +; CHECK: i64.const 9007199254740991{{$}} +; CHECK: i64.and +; CHECK: i64.shl define i53 @shl_i53(i53 %a, i53 %b, i53* %p) { %t = shl i53 %a, %b ret i53 %t @@ -33,9 +33,9 @@ } ; CHECK-LABEL: fpext_f32_f64: -; CHECK: f32.load $push0=, 0($0){{$}} -; CHECK: f64.promote/f32 $push1=, $pop0{{$}} -; CHECK: return $pop1{{$}} +; CHECK: f32.load 0{{$}} +; CHECK: f64.promote/f32{{$}} +; CHECK: return{{$}} define double @fpext_f32_f64(float *%p) { %v = load float, float* %p %e = fpext float %v to double @@ -43,9 +43,9 @@ } ; CHECK-LABEL: fpconv_f64_f32: -; CHECK: f64.load $push0=, 0($0){{$}} -; CHECK: f32.demote/f64 $push1=, $pop0{{$}} -; CHECK: return $pop1{{$}} +; CHECK: f64.load 0{{$}} +; CHECK: f32.demote/f64{{$}} +; CHECK: return{{$}} define float @fpconv_f64_f32(double *%p) { %v = load double, double* %p %e = fptrunc double %v to float Index: test/CodeGen/WebAssembly/libcalls.ll =================================================================== --- test/CodeGen/WebAssembly/libcalls.ll +++ test/CodeGen/WebAssembly/libcalls.ll @@ -52,9 +52,9 @@ ; CHECK-LABEL: f64libcalls: define double @f64libcalls(double %x, double %y) { - ; CHECK: f64.call $push{{[0-9]}}=, cos@FUNCTION + ; CHECK: f64.call cos@FUNCTION %a = call double @llvm.cos.f64(double %x) - ; CHECK: f64.call $push{{[0-9]}}=, log10@FUNCTION + ; CHECK: f64.call log10@FUNCTION %b = call double @llvm.log10.f64(double %a) ret double %b } @@ -91,17 +91,17 @@ ; CHECK-LABEL: unordt: define i1 @unordt(fp128 %x, fp128 %y) { - ; CHECK: i32.call $push[[CALL:[0-9]]]=, __unordtf2 - ; CHECK-NEXT: i32.const $push[[ZERO:[0-9]+]]=, 0 - ; CHECK-NEXT: i32.ne $push{{[0-9]}}=, $pop[[CALL]], $pop[[ZERO]] + ; CHECK: i32.call __unordtf2 + ; CHECK-NEXT: i32.const 0 + ; CHECK-NEXT: i32.ne %a = fcmp uno fp128 %x, %y ret i1 %a } ; CHECK-LABEL: ordt: define i1 @ordt(fp128 %x, fp128 %y) { - ; CHECK: i32.call $push[[CALL:[0-9]]]=, __unordtf2 - ; CHECK-NEXT: i32.eqz $push{{[0-9]}}=, $pop[[CALL]] + ; CHECK: i32.call __unordtf2 + ; CHECK-NEXT: i32.eqz %a = fcmp ord fp128 %x, %y ret i1 %a } Index: test/CodeGen/WebAssembly/load-ext-atomic.ll =================================================================== --- test/CodeGen/WebAssembly/load-ext-atomic.ll +++ test/CodeGen/WebAssembly/load-ext-atomic.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -mattr=+atomics,+sign-ext -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -mattr=+atomics,+sign-ext -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that extending loads are assembled properly. @@ -6,9 +6,9 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: sext_i8_i32: -; CHECK: i32.atomic.load8_u $push0=, 0($0){{$}} -; CHECK-NEXT: i32.extend8_s $push1=, $pop0{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: i32.atomic.load8_u 0{{$}} +; CHECK-NEXT: i32.extend8_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sext_i8_i32(i8 *%p) { %v = load atomic i8, i8* %p seq_cst, align 1 %e = sext i8 %v to i32 @@ -16,8 +16,8 @@ } ; CHECK-LABEL: zext_i8_i32: -; CHECK: i32.atomic.load8_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.atomic.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @zext_i8_i32(i8 *%p) { e1: %v = load atomic i8, i8* %p seq_cst, align 1 @@ -26,9 +26,9 @@ } ; CHECK-LABEL: sext_i16_i32: -; CHECK: i32.atomic.load16_u $push0=, 0($0){{$}} -; CHECK-NEXT: i32.extend16_s $push1=, $pop0{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: i32.atomic.load16_u 0{{$}} +; CHECK-NEXT: i32.extend16_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @sext_i16_i32(i16 *%p) { %v = load atomic i16, i16* %p seq_cst, align 2 %e = sext i16 %v to i32 @@ -36,8 +36,8 @@ } ; CHECK-LABEL: zext_i16_i32: -; CHECK: i32.atomic.load16_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.atomic.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @zext_i16_i32(i16 *%p) { %v = load atomic i16, i16* %p seq_cst, align 2 %e = zext i16 %v to i32 @@ -45,9 +45,9 @@ } ; CHECK-LABEL: sext_i8_i64: -; CHECK: i64.atomic.load8_u $push0=, 0($0){{$}} -; CHECK: i64.extend8_s $push1=, $pop0{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: i64.atomic.load8_u 0{{$}} +; CHECK: i64.extend8_s{{$}} +; CHECK-NEXT: return{{$}} define i64 @sext_i8_i64(i8 *%p) { %v = load atomic i8, i8* %p seq_cst, align 1 %e = sext i8 %v to i64 @@ -55,8 +55,8 @@ } ; CHECK-LABEL: zext_i8_i64: -; CHECK: i64.atomic.load8_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i64.atomic.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @zext_i8_i64(i8 *%p) { %v = load atomic i8, i8* %p seq_cst, align 1 %e = zext i8 %v to i64 @@ -64,9 +64,9 @@ } ; CHECK-LABEL: sext_i16_i64: -; CHECK: i64.atomic.load16_u $push0=, 0($0){{$}} -; CHECK: i64.extend16_s $push1=, $pop0{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: i64.atomic.load16_u 0{{$}} +; CHECK: i64.extend16_s{{$}} +; CHECK-NEXT: return{{$}} define i64 @sext_i16_i64(i16 *%p) { %v = load atomic i16, i16* %p seq_cst, align 2 %e = sext i16 %v to i64 @@ -74,8 +74,8 @@ } ; CHECK-LABEL: zext_i16_i64: -; CHECK: i64.atomic.load16_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i64.atomic.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @zext_i16_i64(i16 *%p) { %v = load atomic i16, i16* %p seq_cst, align 2 %e = zext i16 %v to i64 @@ -83,9 +83,9 @@ } ; CHECK-LABEL: sext_i32_i64: -; CHECK: i32.atomic.load $push0=, 0($0){{$}} -; CHECK: i64.extend_s/i32 $push1=, $pop0{{$}} -; CHECK-NEXT: return $pop1{{$}} +; CHECK: i32.atomic.load 0{{$}} +; CHECK: i64.extend_s/i32{{$}} +; CHECK-NEXT: return{{$}} define i64 @sext_i32_i64(i32 *%p) { %v = load atomic i32, i32* %p seq_cst, align 4 %e = sext i32 %v to i64 @@ -93,8 +93,8 @@ } ; CHECK-LABEL: zext_i32_i64: -; CHECK: i64.atomic.load32_u $push0=, 0($0){{$}} -; CHECK: return $pop0{{$}} +; CHECK: i64.atomic.load32_u 0{{$}} +; CHECK: return{{$}} define i64 @zext_i32_i64(i32 *%p) { %v = load atomic i32, i32* %p seq_cst, align 4 %e = zext i32 %v to i64 Index: test/CodeGen/WebAssembly/load-ext.ll =================================================================== --- test/CodeGen/WebAssembly/load-ext.ll +++ test/CodeGen/WebAssembly/load-ext.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that extending loads are assembled properly. @@ -6,8 +6,8 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: sext_i8_i32: -; CHECK: i32.load8_s $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.load8_s 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @sext_i8_i32(i8 *%p) { %v = load i8, i8* %p %e = sext i8 %v to i32 @@ -15,8 +15,8 @@ } ; CHECK-LABEL: zext_i8_i32: -; CHECK: i32.load8_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @zext_i8_i32(i8 *%p) { %v = load i8, i8* %p %e = zext i8 %v to i32 @@ -24,8 +24,8 @@ } ; CHECK-LABEL: sext_i16_i32: -; CHECK: i32.load16_s $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.load16_s 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @sext_i16_i32(i16 *%p) { %v = load i16, i16* %p %e = sext i16 %v to i32 @@ -33,8 +33,8 @@ } ; CHECK-LABEL: zext_i16_i32: -; CHECK: i32.load16_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @zext_i16_i32(i16 *%p) { %v = load i16, i16* %p %e = zext i16 %v to i32 @@ -42,8 +42,8 @@ } ; CHECK-LABEL: sext_i8_i64: -; CHECK: i64.load8_s $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i64.load8_s 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @sext_i8_i64(i8 *%p) { %v = load i8, i8* %p %e = sext i8 %v to i64 @@ -51,8 +51,8 @@ } ; CHECK-LABEL: zext_i8_i64: -; CHECK: i64.load8_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i64.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @zext_i8_i64(i8 *%p) { %v = load i8, i8* %p %e = zext i8 %v to i64 @@ -60,8 +60,8 @@ } ; CHECK-LABEL: sext_i16_i64: -; CHECK: i64.load16_s $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i64.load16_s 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @sext_i16_i64(i16 *%p) { %v = load i16, i16* %p %e = sext i16 %v to i64 @@ -69,8 +69,8 @@ } ; CHECK-LABEL: zext_i16_i64: -; CHECK: i64.load16_u $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i64.load16_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @zext_i16_i64(i16 *%p) { %v = load i16, i16* %p %e = zext i16 %v to i64 @@ -78,8 +78,8 @@ } ; CHECK-LABEL: sext_i32_i64: -; CHECK: i64.load32_s $push0=, 0($0){{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i64.load32_s 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @sext_i32_i64(i32 *%p) { %v = load i32, i32* %p %e = sext i32 %v to i64 @@ -87,8 +87,8 @@ } ; CHECK-LABEL: zext_i32_i64: -; CHECK: i64.load32_u $push0=, 0($0){{$}} -; CHECK: return $pop0{{$}} +; CHECK: i64.load32_u 0{{$}} +; CHECK: return{{$}} define i64 @zext_i32_i64(i32 *%p) { %v = load i32, i32* %p %e = zext i32 %v to i64 Index: test/CodeGen/WebAssembly/load-store-i1.ll =================================================================== --- test/CodeGen/WebAssembly/load-store-i1.ll +++ test/CodeGen/WebAssembly/load-store-i1.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that i1 extending loads and truncating stores are assembled properly. @@ -6,8 +6,8 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: load_u_i1_i32: -; CHECK: i32.load8_u $push[[NUM0:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM0]]{{$}} +; CHECK: i32.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @load_u_i1_i32(i1* %p) { %v = load i1, i1* %p %e = zext i1 %v to i32 @@ -15,12 +15,12 @@ } ; CHECK-LABEL: load_s_i1_i32: -; CHECK: i32.const $push[[NUM3:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.load8_u $push[[NUM0:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: i32.const $push[[NUM1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.and $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: i32.sub $push[[NUM4:[0-9]+]]=, $pop[[NUM3]], $pop[[NUM2]]{{$}} -; CHECK-NEXT: return $pop[[NUM4]]{{$}} +; CHECK: i32.const 0{{$}} +; CHECK-NEXT: i32.load8_u 0{{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: i32.sub{{$}} +; CHECK-NEXT: return{{$}} define i32 @load_s_i1_i32(i1* %p) { %v = load i1, i1* %p %e = sext i1 %v to i32 @@ -28,8 +28,8 @@ } ; CHECK-LABEL: load_u_i1_i64: -; CHECK: i64.load8_u $push[[NUM0:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM0]]{{$}} +; CHECK: i64.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @load_u_i1_i64(i1* %p) { %v = load i1, i1* %p %e = zext i1 %v to i64 @@ -37,12 +37,12 @@ } ; CHECK-LABEL: load_s_i1_i64: -; CHECK: i64.const $push[[NUM3:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.load8_u $push[[NUM0:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: i64.const $push[[NUM1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.and $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: i64.sub $push[[NUM4:[0-9]+]]=, $pop[[NUM3]], $pop[[NUM2]]{{$}} -; CHECK-NEXT: return $pop[[NUM4]]{{$}} +; CHECK: i64.const 0{{$}} +; CHECK-NEXT: i64.load8_u 0{{$}} +; CHECK-NEXT: i64.const 1{{$}} +; CHECK-NEXT: i64.and{{$}} +; CHECK-NEXT: i64.sub{{$}} +; CHECK-NEXT: return{{$}} define i64 @load_s_i1_i64(i1* %p) { %v = load i1, i1* %p %e = sext i1 %v to i64 @@ -50,9 +50,9 @@ } ; CHECK-LABEL: store_i32_i1: -; CHECK: i32.const $push[[NUM0:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.and $push[[NUM1:[0-9]+]]=, $1, $pop[[NUM0]]{{$}} -; CHECK-NEXT: i32.store8 0($0), $pop[[NUM1]]{{$}} +; CHECK: i32.const 1{{$}} +; CHECK-NEXT: i32.and +; CHECK-NEXT: i32.store8 0{{$}} define void @store_i32_i1(i1* %p, i32 %v) { %t = trunc i32 %v to i1 store i1 %t, i1* %p @@ -60,9 +60,9 @@ } ; CHECK-LABEL: store_i64_i1: -; CHECK: i64.const $push[[NUM0:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.and $push[[NUM1:[0-9]+]]=, $1, $pop[[NUM0]]{{$}} -; CHECK-NEXT: i64.store8 0($0), $pop[[NUM1]]{{$}} +; CHECK: i64.const 1{{$}} +; CHECK-NEXT: i64.and +; CHECK-NEXT: i64.store8 0{{$}} define void @store_i64_i1(i1* %p, i64 %v) { %t = trunc i64 %v to i1 store i1 %t, i1* %p Index: test/CodeGen/WebAssembly/load.ll =================================================================== --- test/CodeGen/WebAssembly/load.ll +++ test/CodeGen/WebAssembly/load.ll @@ -9,9 +9,9 @@ ; CHECK-LABEL: ldi32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @ldi32(i32 *%p) { %v = load i32, i32* %p ret i32 %v @@ -20,9 +20,9 @@ ; CHECK-LABEL: ldi64: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: i64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i64.load 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @ldi64(i64 *%p) { %v = load i64, i64* %p ret i64 %v @@ -31,9 +31,9 @@ ; CHECK-LABEL: ldf32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f32.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f32.load 0{{$}} +; CHECK-NEXT: return{{$}} define float @ldf32(float *%p) { %v = load float, float* %p ret float %v @@ -42,9 +42,9 @@ ; CHECK-LABEL: ldf64: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: f64.load $push[[NUM:[0-9]+]]=, 0($pop[[L0]]){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: f64.load 0{{$}} +; CHECK-NEXT: return{{$}} define double @ldf64(double *%p) { %v = load double, double* %p ret double %v Index: test/CodeGen/WebAssembly/lower-global-dtors.ll =================================================================== --- test/CodeGen/WebAssembly/lower-global-dtors.ll +++ test/CodeGen/WebAssembly/lower-global-dtors.ll @@ -45,11 +45,11 @@ ; CHECK-LABEL: .Lregister_call_dtors.0: ; CHECK-NEXT: block -; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.0@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push1=, 0 -; CHECK-NEXT: i32.const $push0=, __dso_handle -; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}} -; CHECK-NEXT: br_if 0, $pop3 +; CHECK-NEXT: i32.const .Lcall_dtors.0@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: i32.const __dso_handle +; CHECK-NEXT: i32.call __cxa_atexit@FUNCTION{{$}} +; CHECK-NEXT: br_if 0 ; CHECK-NEXT: return ; CHECK: end_block ; CHECK-NEXT: unreachable @@ -61,11 +61,11 @@ ; CHECK-LABEL: .Lregister_call_dtors.1: ; CHECK-NEXT: block -; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.1@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push1=, 0 -; CHECK-NEXT: i32.const $push0=, __dso_handle -; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}} -; CHECK-NEXT: br_if 0, $pop3 +; CHECK-NEXT: i32.const .Lcall_dtors.1@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: i32.const __dso_handle +; CHECK-NEXT: i32.call __cxa_atexit@FUNCTION{{$}} +; CHECK-NEXT: br_if 0 ; CHECK-NEXT: return ; CHECK: end_block ; CHECK-NEXT: unreachable @@ -76,11 +76,11 @@ ; CHECK-LABEL: .Lregister_call_dtors.1.associated1c0: ; CHECK-NEXT: block -; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.1.associated1c0@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push1=, 0 -; CHECK-NEXT: i32.const $push0=, __dso_handle -; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}} -; CHECK-NEXT: br_if 0, $pop3 +; CHECK-NEXT: i32.const .Lcall_dtors.1.associated1c0@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: i32.const __dso_handle +; CHECK-NEXT: i32.call __cxa_atexit@FUNCTION{{$}} +; CHECK-NEXT: br_if 0 ; CHECK-NEXT: return ; CHECK: end_block ; CHECK-NEXT: unreachable @@ -92,11 +92,11 @@ ; CHECK-LABEL: .Lregister_call_dtors.1.associated1c1: ; CHECK-NEXT: block -; CHECK-NEXT: i32.const $push2=, .Lcall_dtors.1.associated1c1@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push1=, 0 -; CHECK-NEXT: i32.const $push0=, __dso_handle -; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}} -; CHECK-NEXT: br_if 0, $pop3 +; CHECK-NEXT: i32.const .Lcall_dtors.1.associated1c1@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: i32.const __dso_handle +; CHECK-NEXT: i32.call __cxa_atexit@FUNCTION{{$}} +; CHECK-NEXT: br_if 0 ; CHECK-NEXT: return ; CHECK: end_block ; CHECK-NEXT: unreachable @@ -107,11 +107,11 @@ ; CHECK-LABEL: .Lregister_call_dtors: ; CHECK-NEXT: block -; CHECK-NEXT: i32.const $push2=, .Lcall_dtors@FUNCTION{{$}} -; CHECK-NEXT: i32.const $push1=, 0 -; CHECK-NEXT: i32.const $push0=, __dso_handle -; CHECK-NEXT: i32.call $push3=, __cxa_atexit@FUNCTION, $pop2, $pop1, $pop0{{$}} -; CHECK-NEXT: br_if 0, $pop3 +; CHECK-NEXT: i32.const .Lcall_dtors@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: i32.const __dso_handle +; CHECK-NEXT: i32.call __cxa_atexit@FUNCTION{{$}} +; CHECK-NEXT: br_if 0 ; CHECK-NEXT: return ; CHECK: end_block ; CHECK-NEXT: unreachable Index: test/CodeGen/WebAssembly/mem-intrinsics.ll =================================================================== --- test/CodeGen/WebAssembly/mem-intrinsics.ll +++ test/CodeGen/WebAssembly/mem-intrinsics.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -tail-dup-placement=0 | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -tail-dup-placement=0 | FileCheck %s ; Test memcpy, memmove, and memset intrinsics. @@ -12,15 +12,15 @@ ; Test that return values are optimized. ; CHECK-LABEL: copy_yes: -; CHECK: i32.call $push0=, memcpy@FUNCTION, $0, $1, $2{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.call memcpy@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} define i8* @copy_yes(i8* %dst, i8* %src, i32 %len) { call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, i32 %len, i1 false) ret i8* %dst } ; CHECK-LABEL: copy_no: -; CHECK: i32.call $drop=, memcpy@FUNCTION, $0, $1, $2{{$}} +; CHECK: i32.call memcpy@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} define void @copy_no(i8* %dst, i8* %src, i32 %len) { call void @llvm.memcpy.p0i8.p0i8.i32(i8* %dst, i8* %src, i32 %len, i1 false) @@ -28,15 +28,15 @@ } ; CHECK-LABEL: move_yes: -; CHECK: i32.call $push0=, memmove@FUNCTION, $0, $1, $2{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.call memmove@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} define i8* @move_yes(i8* %dst, i8* %src, i32 %len) { call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, i32 %len, i1 false) ret i8* %dst } ; CHECK-LABEL: move_no: -; CHECK: i32.call $drop=, memmove@FUNCTION, $0, $1, $2{{$}} +; CHECK: i32.call memmove@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} define void @move_no(i8* %dst, i8* %src, i32 %len) { call void @llvm.memmove.p0i8.p0i8.i32(i8* %dst, i8* %src, i32 %len, i1 false) @@ -44,15 +44,15 @@ } ; CHECK-LABEL: set_yes: -; CHECK: i32.call $push0=, memset@FUNCTION, $0, $1, $2{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: i32.call memset@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} define i8* @set_yes(i8* %dst, i8 %src, i32 %len) { call void @llvm.memset.p0i8.i32(i8* %dst, i8 %src, i32 %len, i1 false) ret i8* %dst } ; CHECK-LABEL: set_no: -; CHECK: i32.call $drop=, memset@FUNCTION, $0, $1, $2{{$}} +; CHECK: i32.call memset@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} define void @set_no(i8* %dst, i8 %src, i32 %len) { call void @llvm.memset.p0i8.i32(i8* %dst, i8 %src, i32 %len, i1 false) @@ -61,8 +61,8 @@ ; CHECK-LABEL: frame_index: -; CHECK: i32.call $drop=, memset@FUNCTION, $pop{{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK: i32.call $push{{[0-9]+}}=, memset@FUNCTION, ${{[0-9]+}}, $pop{{[0-9]+}}, $pop{{[0-9]+}}{{$}} +; CHECK: i32.call memset@FUNCTION{{$}} +; CHECK: i32.call memset@FUNCTION{{$}} ; CHECK: return{{$}} define void @frame_index() { entry: @@ -80,7 +80,7 @@ ; this specific functionality. ; CHECK-LABEL: drop_result: -; CHECK: i32.call $drop=, memset@FUNCTION, $0, $1, $2 +; CHECK: i32.call memset@FUNCTION declare i8* @def() declare void @block_tail_dup() define i8* @drop_result(i8* %arg, i8 %arg1, i32 %arg2, i32 %arg3, i32 %arg4) { @@ -113,7 +113,7 @@ ; result of the memset *is* stackified. ; CHECK-LABEL: tail_dup_to_reuse_result: -; CHECK: i32.call $push{{[0-9]+}}=, memset@FUNCTION, $0, $1, $2 +; CHECK: i32.call memset@FUNCTION define i8* @tail_dup_to_reuse_result(i8* %arg, i8 %arg1, i32 %arg2, i32 %arg3, i32 %arg4) { bb: %tmp = icmp eq i32 %arg3, 0 Index: test/CodeGen/WebAssembly/memory-addr32.ll =================================================================== --- test/CodeGen/WebAssembly/memory-addr32.ll +++ test/CodeGen/WebAssembly/memory-addr32.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that basic memory operations assemble as expected with 32-bit addresses. @@ -14,8 +14,8 @@ ; CHECK-LABEL: memory_size: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: memory.size $push0=, 0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: memory.size 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @memory_size() { %a = call i32 @llvm.wasm.memory.size.i32(i32 0) ret i32 %a @@ -24,8 +24,8 @@ ; CHECK-LABEL: memory_grow: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK: memory.grow $push0=, 0, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: memory.grow 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @memory_grow(i32 %n) { %a = call i32 @llvm.wasm.memory.grow.i32(i32 0, i32 %n) ret i32 %a @@ -33,8 +33,8 @@ ; CHECK-LABEL: mem_size: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: mem.size $push0=, 0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: mem.size 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @mem_size() { %a = call i32 @llvm.wasm.mem.size.i32(i32 0) ret i32 %a @@ -43,8 +43,8 @@ ; CHECK-LABEL: mem_grow: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK: mem.grow $push0=, 0, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: mem.grow 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @mem_grow(i32 %n) { %a = call i32 @llvm.wasm.mem.grow.i32(i32 0, i32 %n) ret i32 %a @@ -52,8 +52,8 @@ ; CHECK-LABEL: current_memory: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: current_memory $push0={{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: current_memory{{$}} +; CHECK-NEXT: return{{$}} define i32 @current_memory() { %a = call i32 @llvm.wasm.current.memory.i32() ret i32 %a @@ -62,8 +62,8 @@ ; CHECK-LABEL: grow_memory: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK: grow_memory $push0=, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK: grow_memory +; CHECK-NEXT: return{{$}} define i32 @grow_memory(i32 %n) { %a = call i32 @llvm.wasm.grow.memory.i32(i32 %n) ret i32 %a Index: test/CodeGen/WebAssembly/muloti4.ll =================================================================== --- test/CodeGen/WebAssembly/muloti4.ll +++ test/CodeGen/WebAssembly/muloti4.ll @@ -14,6 +14,6 @@ ret i128 %X } -; CHECK: call __muloti4@FUNCTION, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}, $pop{{[0-9]*}}{{$}} +; CHECK: call __muloti4@FUNCTION{{$}} declare { i128, i1 } @llvm.smul.with.overflow.i128(i128, i128) nounwind readnone Index: test/CodeGen/WebAssembly/negative-base-reg.ll =================================================================== --- test/CodeGen/WebAssembly/negative-base-reg.ll +++ test/CodeGen/WebAssembly/negative-base-reg.ll @@ -10,17 +10,17 @@ ; If LSR stops selecting a negative base reg value, then this test will no ; longer be useful as written. -; CHECK: i32.const $push[[L0:[0-9]+]]=, -128 -; CHECK-NEXT: set_local 0, $pop[[L0]] +; CHECK: i32.const -128 +; CHECK-NEXT: set_local 0 entry: br label %for.body for.body: ; preds = %for.body, %entry %i.04 = phi i32 [ 0, %entry ], [ %inc, %for.body ] ; The offset should not be folded into the store. -; CHECK: i32.const $push{{[0-9]+}}=, args+128 -; CHECK: i32.add $push[[L1:[0-9]+]]=, -; CHECK: i32.store 0($pop[[L1]]) +; CHECK: i32.const args+128 +; CHECK: i32.add +; CHECK: i32.store 0 %arrayidx = getelementptr inbounds [32 x i32], [32 x i32]* @args, i32 0, i32 %i.04 store i32 1, i32* %arrayidx, align 4, !tbaa !1 %inc = add nuw nsw i32 %i.04, 1 Index: test/CodeGen/WebAssembly/offset-atomics.ll =================================================================== --- test/CodeGen/WebAssembly/offset-atomics.ll +++ test/CodeGen/WebAssembly/offset-atomics.ll @@ -1,5 +1,5 @@ ; RUN: not llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -mattr=+atomics,+sign-ext | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -mattr=+atomics,+sign-ext | FileCheck %s ; Test that atomic loads are assembled properly. @@ -9,8 +9,8 @@ ; Basic load. ; CHECK-LABEL: load_i32_no_offset: -; CHECK: i32.atomic.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.atomic.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @load_i32_no_offset(i32 *%p) { %v = load atomic i32, i32* %p seq_cst, align 4 ret i32 %v @@ -19,7 +19,7 @@ ; With an nuw add, we can fold an offset. ; CHECK-LABEL: load_i32_with_folded_offset: -; CHECK: i32.atomic.load $push0=, 24($0){{$}} +; CHECK: i32.atomic.load 24{{$}} define i32 @load_i32_with_folded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nuw i32 %q, 24 @@ -31,7 +31,7 @@ ; With an inbounds gep, we can fold an offset. ; CHECK-LABEL: load_i32_with_folded_gep_offset: -; CHECK: i32.atomic.load $push0=, 24($0){{$}} +; CHECK: i32.atomic.load 24{{$}} define i32 @load_i32_with_folded_gep_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 6 %t = load atomic i32, i32* %s seq_cst, align 4 @@ -41,9 +41,9 @@ ; We can't fold a negative offset though, even with an inbounds gep. ; CHECK-LABEL: load_i32_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.atomic.load $push2=, 0($pop1){{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add +; CHECK: i32.atomic.load 0{{$}} define i32 @load_i32_with_unfolded_gep_negative_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 -6 %t = load atomic i32, i32* %s seq_cst, align 4 @@ -53,9 +53,9 @@ ; Without nuw, and even with nsw, we can't fold an offset. ; CHECK-LABEL: load_i32_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.atomic.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i32.atomic.load 0{{$}} define i32 @load_i32_with_unfolded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nsw i32 %q, 24 @@ -67,9 +67,9 @@ ; Without inbounds, we can't fold a gep offset. ; CHECK-LABEL: load_i32_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.atomic.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i32.atomic.load 0{{$}} define i32 @load_i32_with_unfolded_gep_offset(i32* %p) { %s = getelementptr i32, i32* %p, i32 6 %t = load atomic i32, i32* %s seq_cst, align 4 @@ -77,8 +77,8 @@ } ; CHECK-LABEL: load_i64_no_offset: -; CHECK: i64.atomic.load $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i64.atomic.load 0{{$}} +; CHECK-NEXT: return{{$}} define i64 @load_i64_no_offset(i64 *%p) { %v = load atomic i64, i64* %p seq_cst, align 8 ret i64 %v @@ -87,7 +87,7 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_folded_offset: -; CHECK: i64.atomic.load $push0=, 24($0){{$}} +; CHECK: i64.atomic.load 24{{$}} define i64 @load_i64_with_folded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nuw i32 %q, 24 @@ -99,7 +99,7 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_folded_gep_offset: -; CHECK: i64.atomic.load $push0=, 24($0){{$}} +; CHECK: i64.atomic.load 24{{$}} define i64 @load_i64_with_folded_gep_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 3 %t = load atomic i64, i64* %s seq_cst, align 8 @@ -109,9 +109,9 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.atomic.load $push2=, 0($pop1){{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add +; CHECK: i64.atomic.load 0{{$}} define i64 @load_i64_with_unfolded_gep_negative_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 -3 %t = load atomic i64, i64* %s seq_cst, align 8 @@ -121,9 +121,9 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.atomic.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i64.atomic.load 0{{$}} define i64 @load_i64_with_unfolded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nsw i32 %q, 24 @@ -135,9 +135,9 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.atomic.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i64.atomic.load 0{{$}} define i64 @load_i64_with_unfolded_gep_offset(i64* %p) { %s = getelementptr i64, i64* %p, i32 3 %t = load atomic i64, i64* %s seq_cst, align 8 @@ -145,8 +145,8 @@ } ; CHECK-LABEL: load_i32_with_folded_or_offset: -; CHECK: i32.atomic.load8_u $push[[R1:[0-9]+]]=, 2($pop{{[0-9]+}}){{$}} -; CHECK-NEXT: i32.extend8_s $push{{[0-9]+}}=, $pop[[R1]]{{$}} +; CHECK: i32.atomic.load8_u 2{{$}} +; CHECK-NEXT: i32.extend8_s{{$}} define i32 @load_i32_with_folded_or_offset(i32 %x) { %and = and i32 %x, -4 %t0 = inttoptr i32 %and to i8* @@ -160,7 +160,9 @@ ; CHECK-LABEL: store_i32_no_offset: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.atomic.store 0($0), $1{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.atomic.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_i32_no_offset(i32 *%p, i32 %v) { store atomic i32 %v, i32* %p seq_cst, align 4 @@ -170,7 +172,7 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_folded_offset: -; CHECK: i32.atomic.store 24($0), $pop0{{$}} +; CHECK: i32.atomic.store 24{{$}} define void @store_i32_with_folded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nuw i32 %q, 24 @@ -182,7 +184,7 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_folded_gep_offset: -; CHECK: i32.atomic.store 24($0), $pop0{{$}} +; CHECK: i32.atomic.store 24{{$}} define void @store_i32_with_folded_gep_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 6 store atomic i32 0, i32* %s seq_cst, align 4 @@ -192,9 +194,11 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.atomic.store 0($pop1), $pop2{{$}} +; CHECK: get_local 0{{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add {{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.atomic.store 0{{$}} define void @store_i32_with_unfolded_gep_negative_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 -6 store atomic i32 0, i32* %s seq_cst, align 4 @@ -204,9 +208,9 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.atomic.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add {{$}} +; CHECK: i32.atomic.store 0{{$}} define void @store_i32_with_unfolded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nsw i32 %q, 24 @@ -218,9 +222,9 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.atomic.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add {{$}} +; CHECK: i32.atomic.store 0{{$}} define void @store_i32_with_unfolded_gep_offset(i32* %p) { %s = getelementptr i32, i32* %p, i32 6 store atomic i32 0, i32* %s seq_cst, align 4 @@ -231,7 +235,9 @@ ; CHECK-LABEL: store_i64_no_offset: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: i64.atomic.store 0($0), $1{{$}} +; CHECK: get_local 0{{$}} +; CHECK: get_local 1{{$}} +; CHECK-NEXT: i64.atomic.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @store_i64_no_offset(i64 *%p, i64 %v) { store atomic i64 %v, i64* %p seq_cst, align 8 @@ -241,7 +247,7 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_folded_offset: -; CHECK: i64.atomic.store 24($0), $pop0{{$}} +; CHECK: i64.atomic.store 24{{$}} define void @store_i64_with_folded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nuw i32 %q, 24 @@ -253,7 +259,7 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_folded_gep_offset: -; CHECK: i64.atomic.store 24($0), $pop0{{$}} +; CHECK: i64.atomic.store 24{{$}} define void @store_i64_with_folded_gep_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 3 store atomic i64 0, i64* %s seq_cst, align 8 @@ -263,9 +269,9 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.atomic.store 0($pop1), $pop2{{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add {{$}} +; CHECK: i64.atomic.store 0{{$}} define void @store_i64_with_unfolded_gep_negative_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 -3 store atomic i64 0, i64* %s seq_cst, align 8 @@ -275,9 +281,9 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.atomic.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add {{$}} +; CHECK: i64.atomic.store 0{{$}} define void @store_i64_with_unfolded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nsw i32 %q, 24 @@ -289,9 +295,9 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.atomic.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add {{$}} +; CHECK: i64.atomic.store 0{{$}} define void @store_i64_with_unfolded_gep_offset(i64* %p) { %s = getelementptr i64, i64* %p, i32 3 store atomic i64 0, i64* %s seq_cst, align 8 @@ -301,8 +307,8 @@ ; When loading from a fixed address, materialize a zero. ; CHECK-LABEL: load_i32_from_numeric_address -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.atomic.load $push1=, 42($pop0){{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.atomic.load 42{{$}} define i32 @load_i32_from_numeric_address() { %s = inttoptr i32 42 to i32* %t = load atomic i32, i32* %s seq_cst, align 4 @@ -311,8 +317,8 @@ ; CHECK-LABEL: load_i32_from_global_address -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.atomic.load $push1=, gv($pop0){{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.atomic.load gv{{$}} @gv = global i32 0 define i32 @load_i32_from_global_address() { %t = load atomic i32, i32* @gv seq_cst, align 4 @@ -320,9 +326,9 @@ } ; CHECK-LABEL: store_i32_to_numeric_address: -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.const $push1=, 0{{$}} -; CHECK-NEXT: i32.atomic.store 42($pop0), $pop1{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.atomic.store 42{{$}} define void @store_i32_to_numeric_address() { %s = inttoptr i32 42 to i32* store atomic i32 0, i32* %s seq_cst, align 4 @@ -330,9 +336,9 @@ } ; CHECK-LABEL: store_i32_to_global_address: -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.const $push1=, 0{{$}} -; CHECK: i32.atomic.store gv($pop0), $pop1{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.atomic.store gv{{$}} define void @store_i32_to_global_address() { store atomic i32 0, i32* @gv seq_cst, align 4 ret void @@ -341,8 +347,8 @@ ; Fold an offset into a sign-extending load. ; CHECK-LABEL: load_i8_s_with_folded_offset: -; CHECK: i32.atomic.load8_u $push0=, 24($0){{$}} -; CHECK-NEXT: i32.extend8_s $push1=, $pop0 +; CHECK: i32.atomic.load8_u 24{{$}} +; CHECK-NEXT: i32.extend8_s define i32 @load_i8_s_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -355,8 +361,8 @@ ; Fold a gep offset into a sign-extending load. ; CHECK-LABEL: load_i8_s_with_folded_gep_offset: -; CHECK: i32.atomic.load8_u $push0=, 24($0){{$}} -; CHECK-NEXT: i32.extend8_s $push1=, $pop0 +; CHECK: i32.atomic.load8_u 24{{$}} +; CHECK-NEXT: i32.extend8_s define i32 @load_i8_s_with_folded_gep_offset(i8* %p) { %s = getelementptr inbounds i8, i8* %p, i32 24 %t = load atomic i8, i8* %s seq_cst, align 1 @@ -365,7 +371,7 @@ } ; CHECK-LABEL: load_i16_s_i64_with_folded_gep_offset: -; CHECK: i64.atomic.load16_u $push0=, 6($0){{$}} +; CHECK: i64.atomic.load16_u 6{{$}} define i64 @load_i16_s_i64_with_folded_gep_offset(i16* %p) { %s = getelementptr inbounds i16, i16* %p, i32 3 %t = load atomic i16, i16* %s seq_cst, align 2 @@ -374,8 +380,8 @@ } ; CHECK-LABEL: load_i64_with_folded_or_offset: -; CHECK: i64.atomic.load8_u $push[[R1:[0-9]+]]=, 2($pop{{[0-9]+}}){{$}} -; CHECK-NEXT: i64.extend8_s $push{{[0-9]+}}=, $pop[[R1]]{{$}} +; CHECK: i64.atomic.load8_u 2{{$}} +; CHECK-NEXT: i64.extend8_s{{$}} define i64 @load_i64_with_folded_or_offset(i32 %x) { %and = and i32 %x, -4 %t0 = inttoptr i32 %and to i8* @@ -389,7 +395,7 @@ ; Fold an offset into a zero-extending load. ; CHECK-LABEL: load_i16_u_with_folded_offset: -; CHECK: i32.atomic.load16_u $push0=, 24($0){{$}} +; CHECK: i32.atomic.load16_u 24{{$}} define i32 @load_i16_u_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -402,7 +408,7 @@ ; Fold a gep offset into a zero-extending load. ; CHECK-LABEL: load_i8_u_with_folded_gep_offset: -; CHECK: i32.atomic.load8_u $push0=, 24($0){{$}} +; CHECK: i32.atomic.load8_u 24{{$}} define i32 @load_i8_u_with_folded_gep_offset(i8* %p) { %s = getelementptr inbounds i8, i8* %p, i32 24 %t = load atomic i8, i8* %s seq_cst, align 1 @@ -415,8 +421,8 @@ ; As above but with extending load. ; CHECK-LABEL: load_zext_i32_from_numeric_address -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.atomic.load16_u $push1=, 42($pop0){{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.atomic.load16_u 42{{$}} define i32 @load_zext_i32_from_numeric_address() { %s = inttoptr i32 42 to i16* %t = load atomic i16, i16* %s seq_cst, align 2 @@ -425,9 +431,9 @@ } ; CHECK-LABEL: load_sext_i32_from_global_address -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.atomic.load8_u $push1=, gv8($pop0){{$}} -; CHECK-NEXT: i32.extend8_s $push2=, $pop1{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.atomic.load8_u gv8{{$}} +; CHECK-NEXT: i32.extend8_s{{$}} @gv8 = global i8 0 define i32 @load_sext_i32_from_global_address() { %t = load atomic i8, i8* @gv8 seq_cst, align 1 @@ -438,8 +444,8 @@ ; Fold an offset into a sign-extending load. ; As above but 32 extended to 64 bit. ; CHECK-LABEL: load_i32_i64_s_with_folded_offset: -; CHECK: i32.atomic.load $push0=, 24($0){{$}} -; CHECK-NEXT: i64.extend_s/i32 $push1=, $pop0{{$}} +; CHECK: i32.atomic.load 24{{$}} +; CHECK-NEXT: i64.extend_s/i32{{$}} define i64 @load_i32_i64_s_with_folded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nuw i32 %q, 24 @@ -452,7 +458,7 @@ ; Fold a gep offset into a zero-extending load. ; As above but 32 extended to 64 bit. ; CHECK-LABEL: load_i32_i64_u_with_folded_gep_offset: -; CHECK: i64.atomic.load32_u $push0=, 96($0){{$}} +; CHECK: i64.atomic.load32_u 96{{$}} define i64 @load_i32_i64_u_with_folded_gep_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 24 %t = load atomic i32, i32* %s seq_cst, align 4 @@ -462,8 +468,8 @@ ; i8 return value should test anyext loads ; CHECK-LABEL: ldi8_a1: -; CHECK: i32.atomic.load8_u $push[[NUM:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK: i32.atomic.load8_u 0{{$}} +; CHECK-NEXT: return{{$}} define i8 @ldi8_a1(i8 *%p) { %v = load atomic i8, i8* %p seq_cst, align 1 ret i8 %v @@ -472,7 +478,7 @@ ; Fold an offset into a truncating store. ; CHECK-LABEL: store_i8_with_folded_offset: -; CHECK: i32.atomic.store8 24($0), $pop0{{$}} +; CHECK: i32.atomic.store8 24{{$}} define void @store_i8_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -482,7 +488,7 @@ } ; CHECK-LABEL: store_i16_with_folded_offset: -; CHECK: i32.atomic.store16 24($0), $pop0{{$}} +; CHECK: i32.atomic.store16 24{{$}} define void @store_i16_with_folded_offset(i16* %p) { %q = ptrtoint i16* %p to i32 %r = add nuw i32 %q, 24 @@ -492,7 +498,7 @@ } ; CHECK-LABEL: store_i8_i64_with_folded_offset: -; CHECK: i64.atomic.store8 24($0), $1{{$}} +; CHECK: i64.atomic.store8 24{{$}} define void @store_i8_i64_with_folded_offset(i8* %p, i64 %v) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -503,7 +509,7 @@ } ; CHECK-LABEL: store_i16_i64_with_folded_offset: -; CHECK: i64.atomic.store16 24($0), $1{{$}} +; CHECK: i64.atomic.store16 24{{$}} define void @store_i16_i64_with_folded_offset(i16* %p, i64 %v) { %q = ptrtoint i16* %p to i32 %r = add nuw i32 %q, 24 @@ -514,7 +520,7 @@ } ; CHECK-LABEL: store_i32_i64_with_folded_offset: -; CHECK: i64.atomic.store32 24($0), $1{{$}} +; CHECK: i64.atomic.store32 24{{$}} define void @store_i32_i64_with_folded_offset(i32* %p, i64 %v) { %q = ptrtoint i32* %p to i32 %r = add nuw i32 %q, 24 @@ -527,7 +533,7 @@ ; Fold a gep offset into a truncating store. ; CHECK-LABEL: store_i8_with_folded_gep_offset: -; CHECK: i32.atomic.store8 24($0), $pop0{{$}} +; CHECK: i32.atomic.store8 24{{$}} define void @store_i8_with_folded_gep_offset(i8* %p) { %s = getelementptr inbounds i8, i8* %p, i32 24 store atomic i8 0, i8* %s seq_cst, align 1 @@ -535,7 +541,7 @@ } ; CHECK-LABEL: store_i16_with_folded_gep_offset: -; CHECK: i32.atomic.store16 48($0), $pop0{{$}} +; CHECK: i32.atomic.store16 48{{$}} define void @store_i16_with_folded_gep_offset(i16* %p) { %s = getelementptr inbounds i16, i16* %p, i32 24 store atomic i16 0, i16* %s seq_cst, align 2 @@ -543,7 +549,7 @@ } ; CHECK-LABEL: store_i8_i64_with_folded_gep_offset: -; CHECK: i64.atomic.store8 24($0), $1{{$}} +; CHECK: i64.atomic.store8 24{{$}} define void @store_i8_i64_with_folded_gep_offset(i8* %p, i64 %v) { %s = getelementptr inbounds i8, i8* %p, i32 24 %t = trunc i64 %v to i8 @@ -552,7 +558,7 @@ } ; CHECK-LABEL: store_i16_i64_with_folded_gep_offset: -; CHECK: i64.atomic.store16 48($0), $1{{$}} +; CHECK: i64.atomic.store16 48{{$}} define void @store_i16_i64_with_folded_gep_offset(i16* %p, i64 %v) { %s = getelementptr inbounds i16, i16* %p, i32 24 %t = trunc i64 %v to i16 @@ -561,7 +567,7 @@ } ; CHECK-LABEL: store_i32_i64_with_folded_gep_offset: -; CHECK: i64.atomic.store32 96($0), $1{{$}} +; CHECK: i64.atomic.store32 96{{$}} define void @store_i32_i64_with_folded_gep_offset(i32* %p, i64 %v) { %s = getelementptr inbounds i32, i32* %p, i32 24 %t = trunc i64 %v to i32 @@ -572,7 +578,7 @@ ; Fold an or_is_add pattern based offset into a truncating store. ; CHECK-LABEL: store_i8_with_folded_or_offset: -; CHECK: i32.atomic.store8 2($pop{{[0-9]+}}), $pop{{[0-9]+}}{{$}} +; CHECK: i32.atomic.store8 2{{$}} define void @store_i8_with_folded_or_offset(i32 %x) { %and = and i32 %x, -4 %p = inttoptr i32 %and to i8* @@ -582,7 +588,7 @@ } ; CHECK-LABEL: store_i16_with_folded_or_offset: -; CHECK: i32.atomic.store16 4($pop{{[0-9]+}}), $pop{{[0-9]+}}{{$}} +; CHECK: i32.atomic.store16 4{{$}} define void @store_i16_with_folded_or_offset(i32 %x) { %and = and i32 %x, -4 %p = inttoptr i32 %and to i16* @@ -592,7 +598,7 @@ } ; CHECK-LABEL: store_i8_i64_with_folded_or_offset: -; CHECK: i64.atomic.store8 2($pop{{[0-9]+}}), $1{{$}} +; CHECK: i64.atomic.store8 2{{$}} define void @store_i8_i64_with_folded_or_offset(i32 %x, i64 %v) { %and = and i32 %x, -4 %p = inttoptr i32 %and to i8* @@ -603,7 +609,7 @@ } ; CHECK-LABEL: store_i16_i64_with_folded_or_offset: -; CHECK: i64.atomic.store16 4($pop{{[0-9]+}}), $1{{$}} +; CHECK: i64.atomic.store16 4{{$}} define void @store_i16_i64_with_folded_or_offset(i32 %x, i64 %v) { %and = and i32 %x, -4 %p = inttoptr i32 %and to i16* @@ -614,7 +620,7 @@ } ; CHECK-LABEL: store_i32_i64_with_folded_or_offset: -; CHECK: i64.atomic.store32 8($pop{{[0-9]+}}), $1{{$}} +; CHECK: i64.atomic.store32 8{{$}} define void @store_i32_i64_with_folded_or_offset(i32 %x, i64 %v) { %and = and i32 %x, -4 %p = inttoptr i32 %and to i32* Index: test/CodeGen/WebAssembly/offset-fastisel.ll =================================================================== --- test/CodeGen/WebAssembly/offset-fastisel.ll +++ test/CodeGen/WebAssembly/offset-fastisel.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals -fast-isel -fast-isel-abort=1 | FileCheck %s +; RUN: llc < %s -asm-verbose=false -fast-isel -fast-isel-abort=1 | FileCheck %s ; TODO: Merge this with offset.ll when fast-isel matches better. @@ -6,9 +6,9 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: store_i8_with_variable_gep_offset: -; CHECK: i32.add $push[[L0:[0-9]+]]=, $0, $1{{$}} -; CHECK: i32.const $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK: i32.store8 0($pop[[L0]]), $pop[[L1]]{{$}} +; CHECK: i32.add +; CHECK: i32.const 0{{$}} +; CHECK: i32.store8 0{{$}} define void @store_i8_with_variable_gep_offset(i8* %p, i32 %idx) { %s = getelementptr inbounds i8, i8* %p, i32 %idx store i8 0, i8* %s @@ -16,13 +16,13 @@ } ; CHECK-LABEL: store_i8_with_array_alloca_gep: -; CHECK: get_global $push[[L0:[0-9]+]]=, __stack_pointer -; CHECK: i32.const $push[[L1:[0-9]+]]=, 32{{$}} -; CHECK: i32.sub $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK: copy_local $push[[L3:[0-9]+]]=, $pop[[L2]] -; CHECK: i32.add $push[[L4:[0-9]+]]=, $pop[[L3]], $0{{$}} -; CHECK: i32.const $push[[L5:[0-9]+]]=, 0{{$}} -; CHECK: i32.store8 0($pop[[L4]]), $pop[[L5]]{{$}} +; CHECK: get_global __stack_pointer +; CHECK: i32.const 32{{$}} +; CHECK: i32.sub{{$}} +; CHECK: copy_local +; CHECK: i32.add +; CHECK: i32.const 0{{$}} +; CHECK: i32.store8 0{{$}} define hidden void @store_i8_with_array_alloca_gep(i32 %idx) { %A = alloca [30 x i8], align 16 %s = getelementptr inbounds [30 x i8], [30 x i8]* %A, i32 0, i32 %idx @@ -31,10 +31,10 @@ } ; CHECK-LABEL: store_i32_with_unfolded_gep_offset: -; CHECK: i32.const $push[[L0:[0-9]+]]=, 24{{$}} -; CHECK: i32.add $push[[L1:[0-9]+]]=, $0, $pop[[L0]]{{$}} -; CHECK: i32.const $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK: i32.store 0($pop[[L1]]), $pop[[L2]]{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i32.const 0{{$}} +; CHECK: i32.store 0{{$}} define void @store_i32_with_unfolded_gep_offset(i32* %p) { %s = getelementptr i32, i32* %p, i32 6 store i32 0, i32* %s @@ -42,7 +42,7 @@ } ; CHECK-LABEL: store_i32_with_folded_gep_offset: -; CHECK: i32.store 24($0), $pop{{[0-9]+$}} +; CHECK: i32.store 24 define void @store_i32_with_folded_gep_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 6 store i32 0, i32* %s @@ -50,7 +50,7 @@ } ; CHECK-LABEL: load_i32_with_folded_gep_offset: -; CHECK: i32.load $push{{[0-9]+}}=, 24($0){{$}} +; CHECK: i32.load 24{{$}} define i32 @load_i32_with_folded_gep_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 6 %t = load i32, i32* %s @@ -58,10 +58,10 @@ } ; CHECK-LABEL: store_i64_with_unfolded_gep_offset: -; CHECK: i32.const $push[[L0:[0-9]+]]=, 24{{$}} -; CHECK: i32.add $push[[L1:[0-9]+]]=, $0, $pop[[L0]]{{$}} -; CHECK: i64.const $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK: i64.store 0($pop[[L1]]), $pop[[L2]]{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i64.const 0{{$}} +; CHECK: i64.store 0{{$}} define void @store_i64_with_unfolded_gep_offset(i64* %p) { %s = getelementptr i64, i64* %p, i32 3 store i64 0, i64* %s @@ -69,7 +69,7 @@ } ; CHECK-LABEL: store_i8_with_folded_gep_offset: -; CHECK: i32.store8 24($0), $pop{{[0-9]+$}} +; CHECK: i32.store8 24 define void @store_i8_with_folded_gep_offset(i8* %p) { %s = getelementptr inbounds i8, i8* %p, i32 24 store i8 0, i8* %s @@ -77,7 +77,7 @@ } ; CHECK-LABEL: load_i8_u_with_folded_offset: -; CHECK: i32.load8_u $push{{[0-9]+}}=, 24($0){{$}} +; CHECK: i32.load8_u 24{{$}} define i32 @load_i8_u_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -89,7 +89,7 @@ ; TODO: this should be load8_s, need to fold sign-/zero-extend in fast-isel ; CHECK-LABEL: load_i8_s_with_folded_offset: -; CHECK: i32.load8_u $push{{[0-9]+}}=, 24($0){{$}} +; CHECK: i32.load8_u 24{{$}} define i32 @load_i8_s_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 Index: test/CodeGen/WebAssembly/offset-folding.ll =================================================================== --- test/CodeGen/WebAssembly/offset-folding.ll +++ test/CodeGen/WebAssembly/offset-folding.ll @@ -12,16 +12,16 @@ ; CHECK-LABEL: test0: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, x+188{{$}} -; CHECK=NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.const x+188{{$}} +; CHECK=NEXT: return{{$}} define i32* @test0() { ret i32* getelementptr ([0 x i32], [0 x i32]* @x, i32 0, i32 47) } ; CHECK-LABEL: test1: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, y+188{{$}} -; CHECK=NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.const y+188{{$}} +; CHECK=NEXT: return{{$}} define i32* @test1() { ret i32* getelementptr ([50 x i32], [50 x i32]* @y, i32 0, i32 47) } @@ -30,16 +30,16 @@ ; CHECK-LABEL: test2: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, x{{$}} -; CHECK=NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.const x{{$}} +; CHECK=NEXT: return{{$}} define i32* @test2() { ret i32* getelementptr ([0 x i32], [0 x i32]* @x, i32 0, i32 0) } ; CHECK-LABEL: test3: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, y{{$}} -; CHECK=NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.const y{{$}} +; CHECK=NEXT: return{{$}} define i32* @test3() { ret i32* getelementptr ([50 x i32], [50 x i32]* @y, i32 0, i32 0) } @@ -48,16 +48,16 @@ ; CHECK-LABEL: test4: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, x-188{{$}} -; CHECK=NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.const x-188{{$}} +; CHECK=NEXT: return{{$}} define i32* @test4() { ret i32* getelementptr ([0 x i32], [0 x i32]* @x, i32 0, i32 -47) } ; CHECK-LABEL: test5: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, y-188{{$}} -; CHECK=NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.const y-188{{$}} +; CHECK=NEXT: return{{$}} define i32* @test5() { ret i32* getelementptr ([50 x i32], [50 x i32]* @y, i32 0, i32 -47) } Index: test/CodeGen/WebAssembly/offset.ll =================================================================== --- test/CodeGen/WebAssembly/offset.ll +++ test/CodeGen/WebAssembly/offset.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false | FileCheck %s ; Test constant load and store address offsets. @@ -8,7 +8,7 @@ ; With an nuw add, we can fold an offset. ; CHECK-LABEL: load_i32_with_folded_offset: -; CHECK: i32.load $push0=, 24($0){{$}} +; CHECK: i32.load 24{{$}} define i32 @load_i32_with_folded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nuw i32 %q, 24 @@ -20,7 +20,7 @@ ; With an inbounds gep, we can fold an offset. ; CHECK-LABEL: load_i32_with_folded_gep_offset: -; CHECK: i32.load $push0=, 24($0){{$}} +; CHECK: i32.load 24{{$}} define i32 @load_i32_with_folded_gep_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 6 %t = load i32, i32* %s @@ -30,9 +30,9 @@ ; We can't fold a negative offset though, even with an inbounds gep. ; CHECK-LABEL: load_i32_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.load $push2=, 0($pop1){{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add +; CHECK: i32.load 0{{$}} define i32 @load_i32_with_unfolded_gep_negative_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 -6 %t = load i32, i32* %s @@ -42,9 +42,9 @@ ; Without nuw, and even with nsw, we can't fold an offset. ; CHECK-LABEL: load_i32_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i32.load 0{{$}} define i32 @load_i32_with_unfolded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nsw i32 %q, 24 @@ -56,9 +56,9 @@ ; Without inbounds, we can't fold a gep offset. ; CHECK-LABEL: load_i32_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i32.load 0{{$}} define i32 @load_i32_with_unfolded_gep_offset(i32* %p) { %s = getelementptr i32, i32* %p, i32 6 %t = load i32, i32* %s @@ -68,7 +68,7 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_folded_offset: -; CHECK: i64.load $push0=, 24($0){{$}} +; CHECK: i64.load 24{{$}} define i64 @load_i64_with_folded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nuw i32 %q, 24 @@ -80,7 +80,7 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_folded_gep_offset: -; CHECK: i64.load $push0=, 24($0){{$}} +; CHECK: i64.load 24{{$}} define i64 @load_i64_with_folded_gep_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 3 %t = load i64, i64* %s @@ -90,9 +90,9 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.load $push2=, 0($pop1){{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add +; CHECK: i64.load 0{{$}} define i64 @load_i64_with_unfolded_gep_negative_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 -3 %t = load i64, i64* %s @@ -102,9 +102,9 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i64.load 0{{$}} define i64 @load_i64_with_unfolded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nsw i32 %q, 24 @@ -116,9 +116,9 @@ ; Same as above but with i64. ; CHECK-LABEL: load_i64_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.load $push2=, 0($pop1){{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i64.load 0{{$}} define i64 @load_i64_with_unfolded_gep_offset(i64* %p) { %s = getelementptr i64, i64* %p, i32 3 %t = load i64, i64* %s @@ -126,7 +126,7 @@ } ; CHECK-LABEL: load_i32_with_folded_or_offset: -; CHECK: i32.load8_s $push{{[0-9]+}}=, 2($pop{{[0-9]+}}){{$}} +; CHECK: i32.load8_s 2{{$}} define i32 @load_i32_with_folded_or_offset(i32 %x) { %and = and i32 %x, -4 %t0 = inttoptr i32 %and to i8* @@ -139,7 +139,7 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_folded_offset: -; CHECK: i32.store 24($0), $pop0{{$}} +; CHECK: i32.store 24{{$}} define void @store_i32_with_folded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nuw i32 %q, 24 @@ -151,7 +151,7 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_folded_gep_offset: -; CHECK: i32.store 24($0), $pop0{{$}} +; CHECK: i32.store 24{{$}} define void @store_i32_with_folded_gep_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 6 store i32 0, i32* %s @@ -161,9 +161,9 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.store 0($pop1), $pop2{{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add +; CHECK: i32.store 0{{$}} define void @store_i32_with_unfolded_gep_negative_offset(i32* %p) { %s = getelementptr inbounds i32, i32* %p, i32 -6 store i32 0, i32* %s @@ -173,9 +173,9 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i32.store 0{{$}} define void @store_i32_with_unfolded_offset(i32* %p) { %q = ptrtoint i32* %p to i32 %r = add nsw i32 %q, 24 @@ -187,9 +187,9 @@ ; Same as above but with store. ; CHECK-LABEL: store_i32_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i32.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i32.store 0{{$}} define void @store_i32_with_unfolded_gep_offset(i32* %p) { %s = getelementptr i32, i32* %p, i32 6 store i32 0, i32* %s @@ -199,7 +199,7 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_folded_offset: -; CHECK: i64.store 24($0), $pop0{{$}} +; CHECK: i64.store 24{{$}} define void @store_i64_with_folded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nuw i32 %q, 24 @@ -211,7 +211,7 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_folded_gep_offset: -; CHECK: i64.store 24($0), $pop0{{$}} +; CHECK: i64.store 24{{$}} define void @store_i64_with_folded_gep_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 3 store i64 0, i64* %s @@ -221,9 +221,9 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_unfolded_gep_negative_offset: -; CHECK: i32.const $push0=, -24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.store 0($pop1), $pop2{{$}} +; CHECK: i32.const -24{{$}} +; CHECK: i32.add +; CHECK: i64.store 0{{$}} define void @store_i64_with_unfolded_gep_negative_offset(i64* %p) { %s = getelementptr inbounds i64, i64* %p, i32 -3 store i64 0, i64* %s @@ -233,9 +233,9 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_unfolded_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i64.store 0{{$}} define void @store_i64_with_unfolded_offset(i64* %p) { %q = ptrtoint i64* %p to i32 %r = add nsw i32 %q, 24 @@ -247,9 +247,9 @@ ; Same as above but with store with i64. ; CHECK-LABEL: store_i64_with_unfolded_gep_offset: -; CHECK: i32.const $push0=, 24{{$}} -; CHECK: i32.add $push1=, $0, $pop0{{$}} -; CHECK: i64.store 0($pop1), $pop2{{$}} +; CHECK: i32.const 24{{$}} +; CHECK: i32.add +; CHECK: i64.store 0{{$}} define void @store_i64_with_unfolded_gep_offset(i64* %p) { %s = getelementptr i64, i64* %p, i32 3 store i64 0, i64* %s @@ -257,7 +257,7 @@ } ; CHECK-LABEL: store_i32_with_folded_or_offset: -; CHECK: i32.store8 2($pop{{[0-9]+}}), $pop{{[0-9]+}}{{$}} +; CHECK: i32.store8 2{{$}} define void @store_i32_with_folded_or_offset(i32 %x) { %and = and i32 %x, -4 %t0 = inttoptr i32 %and to i8* @@ -269,8 +269,8 @@ ; When loading from a fixed address, materialize a zero. ; CHECK-LABEL: load_i32_from_numeric_address -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.load $push1=, 42($pop0){{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.load 42{{$}} define i32 @load_i32_from_numeric_address() { %s = inttoptr i32 42 to i32* %t = load i32, i32* %s @@ -278,8 +278,8 @@ } ; CHECK-LABEL: load_i32_from_global_address -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.load $push1=, gv($pop0){{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.load gv{{$}} @gv = global i32 0 define i32 @load_i32_from_global_address() { %t = load i32, i32* @gv @@ -287,9 +287,9 @@ } ; CHECK-LABEL: store_i32_to_numeric_address: -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: i32.const $push1=, 0{{$}} -; CHECK-NEXT: i32.store 42($pop0), $pop1{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: i32.store 42{{$}} define void @store_i32_to_numeric_address() { %s = inttoptr i32 42 to i32* store i32 0, i32* %s @@ -297,9 +297,9 @@ } ; CHECK-LABEL: store_i32_to_global_address: -; CHECK: i32.const $push0=, 0{{$}} -; CHECK: i32.const $push1=, 0{{$}} -; CHECK: i32.store gv($pop0), $pop1{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.store gv{{$}} define void @store_i32_to_global_address() { store i32 0, i32* @gv ret void @@ -308,7 +308,7 @@ ; Fold an offset into a sign-extending load. ; CHECK-LABEL: load_i8_s_with_folded_offset: -; CHECK: i32.load8_s $push0=, 24($0){{$}} +; CHECK: i32.load8_s 24{{$}} define i32 @load_i8_s_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -321,7 +321,7 @@ ; Fold a gep offset into a sign-extending load. ; CHECK-LABEL: load_i8_s_with_folded_gep_offset: -; CHECK: i32.load8_s $push0=, 24($0){{$}} +; CHECK: i32.load8_s 24{{$}} define i32 @load_i8_s_with_folded_gep_offset(i8* %p) { %s = getelementptr inbounds i8, i8* %p, i32 24 %t = load i8, i8* %s @@ -332,7 +332,7 @@ ; Fold an offset into a zero-extending load. ; CHECK-LABEL: load_i8_u_with_folded_offset: -; CHECK: i32.load8_u $push0=, 24($0){{$}} +; CHECK: i32.load8_u 24{{$}} define i32 @load_i8_u_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -345,7 +345,7 @@ ; Fold a gep offset into a zero-extending load. ; CHECK-LABEL: load_i8_u_with_folded_gep_offset: -; CHECK: i32.load8_u $push0=, 24($0){{$}} +; CHECK: i32.load8_u 24{{$}} define i32 @load_i8_u_with_folded_gep_offset(i8* %p) { %s = getelementptr inbounds i8, i8* %p, i32 24 %t = load i8, i8* %s @@ -356,7 +356,7 @@ ; Fold an offset into a truncating store. ; CHECK-LABEL: store_i8_with_folded_offset: -; CHECK: i32.store8 24($0), $pop0{{$}} +; CHECK: i32.store8 24{{$}} define void @store_i8_with_folded_offset(i8* %p) { %q = ptrtoint i8* %p to i32 %r = add nuw i32 %q, 24 @@ -368,7 +368,7 @@ ; Fold a gep offset into a truncating store. ; CHECK-LABEL: store_i8_with_folded_gep_offset: -; CHECK: i32.store8 24($0), $pop0{{$}} +; CHECK: i32.store8 24{{$}} define void @store_i8_with_folded_gep_offset(i8* %p) { %s = getelementptr inbounds i8, i8* %p, i32 24 store i8 0, i8* %s @@ -378,14 +378,14 @@ ; Fold the offsets when lowering aggregate loads and stores. ; CHECK-LABEL: aggregate_load_store: -; CHECK: i32.load $2=, 0($0){{$}} -; CHECK: i32.load $3=, 4($0){{$}} -; CHECK: i32.load $4=, 8($0){{$}} -; CHECK: i32.load $push0=, 12($0){{$}} -; CHECK: i32.store 12($1), $pop0{{$}} -; CHECK: i32.store 8($1), $4{{$}} -; CHECK: i32.store 4($1), $3{{$}} -; CHECK: i32.store 0($1), $2{{$}} +; CHECK: i32.load $2=, 0{{$}} +; CHECK: i32.load $3=, 4{{$}} +; CHECK: i32.load $4=, 8{{$}} +; CHECK: i32.load 12{{$}} +; CHECK: i32.store 12{{$}} +; CHECK: i32.store 8{{$}} +; CHECK: i32.store 4{{$}} +; CHECK: i32.store 0{{$}} define void @aggregate_load_store({i32,i32,i32,i32}* %p, {i32,i32,i32,i32}* %q) { ; volatile so that things stay in order for the tests above %t = load volatile {i32,i32,i32,i32}, {i32, i32,i32,i32}* %p @@ -397,10 +397,10 @@ ; merged into i64 stores. ; CHECK-LABEL: aggregate_return: -; CHECK: i64.const $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK: i64.store 8($0):p2align=2, $pop[[L0]]{{$}} -; CHECK: i64.const $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK: i64.store 0($0):p2align=2, $pop[[L1]]{{$}} +; CHECK: i64.const 0{{$}} +; CHECK: i64.store 8:p2align=2{{$}} +; CHECK: i64.const 0{{$}} +; CHECK: i64.store 0:p2align=2{{$}} define {i32,i32,i32,i32} @aggregate_return() { ret {i32,i32,i32,i32} zeroinitializer } @@ -409,14 +409,14 @@ ; merged. ; CHECK-LABEL: aggregate_return_without_merge: -; CHECK: i32.const $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK: i32.store8 14($0), $pop[[L0]]{{$}} -; CHECK: i32.const $push[[L1:[0-9]+]]=, 0{{$}} -; CHECK: i32.store16 12($0), $pop[[L1]]{{$}} -; CHECK: i32.const $push[[L2:[0-9]+]]=, 0{{$}} -; CHECK: i32.store 8($0), $pop[[L2]]{{$}} -; CHECK: i64.const $push[[L3:[0-9]+]]=, 0{{$}} -; CHECK: i64.store 0($0), $pop[[L3]]{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.store8 14{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.store16 12{{$}} +; CHECK: i32.const 0{{$}} +; CHECK: i32.store 8{{$}} +; CHECK: i64.const 0{{$}} +; CHECK: i64.store 0{{$}} define {i64,i32,i16,i8} @aggregate_return_without_merge() { ret {i64,i32,i16,i8} zeroinitializer } Index: test/CodeGen/WebAssembly/phi.ll =================================================================== --- test/CodeGen/WebAssembly/phi.ll +++ test/CodeGen/WebAssembly/phi.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -verify-machineinstrs | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -verify-machineinstrs | FileCheck %s ; Test that phis are lowered. @@ -9,8 +9,8 @@ ; CHECK-LABEL: test0: ; CHECK: return $0 -; CHECK: div_s $push[[NUM0:[0-9]+]]=, $0, $pop[[NUM1:[0-9]+]]{{$}} -; CHECK: return $pop[[NUM0]]{{$}} +; CHECK: div_s +; CHECK: return{{$}} define i32 @test0(i32 %p) { entry: %t = icmp slt i32 %p, 0 Index: test/CodeGen/WebAssembly/reg-stackify.ll =================================================================== --- test/CodeGen/WebAssembly/reg-stackify.ll +++ test/CodeGen/WebAssembly/reg-stackify.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -verify-machineinstrs | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -verify-machineinstrs | FileCheck %s ; Test the register stackifier pass. @@ -8,7 +8,7 @@ ; No because of pointer aliasing. ; CHECK-LABEL: no0: -; CHECK: return $1{{$}} +; CHECK: return define i32 @no0(i32* %p, i32* %q) { %t = load i32, i32* %q store i32 0, i32* %p @@ -18,7 +18,7 @@ ; No because of side effects. ; CHECK-LABEL: no1: -; CHECK: return $1{{$}} +; CHECK: return define i32 @no1(i32* %p, i32* dereferenceable(4) %q) { %t = load volatile i32, i32* %q, !invariant.load !0 store volatile i32 0, i32* %p @@ -28,7 +28,7 @@ ; Yes because of invariant load and no side effects. ; CHECK-LABEL: yes0: -; CHECK: return $pop{{[0-9]+}}{{$}} +; CHECK: return{{$}} define i32 @yes0(i32* %p, i32* dereferenceable(4) %q) { %t = load i32, i32* %q, !invariant.load !0 store i32 0, i32* %p @@ -38,7 +38,7 @@ ; Yes because of no intervening side effects. ; CHECK-LABEL: yes1: -; CHECK: return $pop0{{$}} +; CHECK: return{{$}} define i32 @yes1(i32* %q) { %t = load volatile i32, i32* %q ret i32 %t @@ -47,7 +47,7 @@ ; Yes because undefined behavior can be sunk past a store. ; CHECK-LABEL: sink_trap: -; CHECK: return $pop{{[0-9]+}}{{$}} +; CHECK: return{{$}} define i32 @sink_trap(i32 %x, i32 %y, i32* %p) { %t = sdiv i32 %x, %y store volatile i32 0, i32* %p @@ -57,7 +57,7 @@ ; Yes because the call is readnone. ; CHECK-LABEL: sink_readnone_call: -; CHECK: return $pop0{{$}} +; CHECK: return{{$}} declare i32 @readnone_callee() readnone nounwind define i32 @sink_readnone_call(i32 %x, i32 %y, i32* %p) { %t = call i32 @readnone_callee() @@ -68,7 +68,7 @@ ; No because the call is readonly and there's an intervening store. ; CHECK-LABEL: no_sink_readonly_call: -; CHECK: return ${{[0-9]+}}{{$}} +; CHECK: return{{$}} declare i32 @readonly_callee() readonly nounwind define i32 @no_sink_readonly_call(i32 %x, i32 %y, i32* %p) { %t = call i32 @readonly_callee() @@ -84,27 +84,31 @@ ; CHECK-LABEL: stack_uses: ; CHECK: .param i32, i32, i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: i32.const $push[[L13:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.lt_s $push[[L0:[0-9]+]]=, $0, $pop[[L13]]{{$}} -; CHECK-NEXT: i32.const $push[[L1:[0-9]+]]=, 2{{$}} -; CHECK-NEXT: i32.lt_s $push[[L2:[0-9]+]]=, $1, $pop[[L1]]{{$}} -; CHECK-NEXT: i32.xor $push[[L5:[0-9]+]]=, $pop[[L0]], $pop[[L2]]{{$}} -; CHECK-NEXT: i32.const $push[[L12:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.lt_s $push[[L3:[0-9]+]]=, $2, $pop[[L12]]{{$}} -; CHECK-NEXT: i32.const $push[[L11:[0-9]+]]=, 2{{$}} -; CHECK-NEXT: i32.lt_s $push[[L4:[0-9]+]]=, $3, $pop[[L11]]{{$}} -; CHECK-NEXT: i32.xor $push[[L6:[0-9]+]]=, $pop[[L3]], $pop[[L4]]{{$}} -; CHECK-NEXT: i32.xor $push[[L7:[0-9]+]]=, $pop[[L5]], $pop[[L6]]{{$}} -; CHECK-NEXT: i32.const $push10=, 1{{$}} -; CHECK-NEXT: i32.ne $push8=, $pop7, $pop10{{$}} -; CHECK-NEXT: br_if 0, $pop8{{$}} -; CHECK-NEXT: i32.const $push9=, 0{{$}} -; CHECK-NEXT: return $pop9{{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: i32.lt_s +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.lt_s +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: get_local 2{{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: i32.lt_s +; CHECK-NEXT: get_local 3{{$}} +; CHECK-NEXT: i32.const 2{{$}} +; CHECK-NEXT: i32.lt_s +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: i32.xor {{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: i32.ne {{$}} +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: return{{$}} ; CHECK-NEXT: .LBB7_2: ; CHECK-NEXT: end_block{{$}} -; CHECK-NEXT: i32.const $push14=, 1{{$}} -; CHECK-NEXT: return $pop14{{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: return{{$}} define i32 @stack_uses(i32 %x, i32 %y, i32 %z, i32 %w) { entry: %c = icmp sle i32 %x, 0 @@ -126,14 +130,21 @@ ; CHECK-LABEL: multiple_uses: ; CHECK: .param i32, i32, i32{{$}} -; CHECK-NEXT: block {{$}} -; CHECK-NEXT: i32.load $push[[NUM0:[0-9]+]]=, 0($2){{$}} -; CHECK-NEXT: tee_local $push[[NUM1:[0-9]+]]=, $3=, $pop[[NUM0]]{{$}} -; CHECK-NEXT: i32.ge_u $push[[NUM2:[0-9]+]]=, $pop[[NUM1]], $1{{$}} -; CHECK-NEXT: br_if 0, $pop[[NUM2]]{{$}} -; CHECK-NEXT: i32.lt_u $push[[NUM3:[0-9]+]]=, $3, $0{{$}} -; CHECK-NEXT: br_if 0, $pop[[NUM3]]{{$}} -; CHECK-NEXT: i32.store 0($2), $3{{$}} +; CHECK: .local i32{{$}} +; CHECK-NEXT: block {{$}} +; CHECK-NEXT: get_local 2{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: tee_local 3{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.ge_u +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: get_local 3{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.lt_u +; CHECK-NEXT: br_if 0{{$}} +; CHECK-NEXT: get_local 2{{$}} +; CHECK-NEXT: get_local 3{{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: .LBB8_3: ; CHECK-NEXT: end_block{{$}} ; CHECK-NEXT: return{{$}} @@ -184,22 +195,38 @@ ; CHECK-LABEL: div_tree: ; CHECK: .param i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.div_s $push[[L0:[0-9]+]]=, $0, $1{{$}} -; CHECK-NEXT: i32.div_s $push[[L1:[0-9]+]]=, $2, $3{{$}} -; CHECK-NEXT: i32.div_s $push[[L2:[0-9]+]]=, $pop[[L0]], $pop[[L1]]{{$}} -; CHECK-NEXT: i32.div_s $push[[L3:[0-9]+]]=, $4, $5{{$}} -; CHECK-NEXT: i32.div_s $push[[L4:[0-9]+]]=, $6, $7{{$}} -; CHECK-NEXT: i32.div_s $push[[L5:[0-9]+]]=, $pop[[L3]], $pop[[L4]]{{$}} -; CHECK-NEXT: i32.div_s $push[[L6:[0-9]+]]=, $pop[[L2]], $pop[[L5]]{{$}} -; CHECK-NEXT: i32.div_s $push[[L7:[0-9]+]]=, $8, $9{{$}} -; CHECK-NEXT: i32.div_s $push[[L8:[0-9]+]]=, $10, $11{{$}} -; CHECK-NEXT: i32.div_s $push[[L9:[0-9]+]]=, $pop[[L7]], $pop[[L8]]{{$}} -; CHECK-NEXT: i32.div_s $push[[L10:[0-9]+]]=, $12, $13{{$}} -; CHECK-NEXT: i32.div_s $push[[L11:[0-9]+]]=, $14, $15{{$}} -; CHECK-NEXT: i32.div_s $push[[L12:[0-9]+]]=, $pop[[L10]], $pop[[L11]]{{$}} -; CHECK-NEXT: i32.div_s $push[[L13:[0-9]+]]=, $pop[[L9]], $pop[[L12]]{{$}} -; CHECK-NEXT: i32.div_s $push[[L14:[0-9]+]]=, $pop[[L6]], $pop[[L13]]{{$}} -; CHECK-NEXT: return $pop[[L14]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: get_local 2{{$}} +; CHECK-NEXT: get_local 3{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: get_local 4{{$}} +; CHECK-NEXT: get_local 5{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: get_local 6{{$}} +; CHECK-NEXT: get_local 7{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: get_local 8{{$}} +; CHECK-NEXT: get_local 9{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: get_local 10{{$}} +; CHECK-NEXT: get_local 11{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: get_local 12{{$}} +; CHECK-NEXT: get_local 13{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: get_local 14{{$}} +; CHECK-NEXT: get_local 15{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: i32.div_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @div_tree(i32 %a, i32 %b, i32 %c, i32 %d, i32 %e, i32 %f, i32 %g, i32 %h, i32 %i, i32 %j, i32 %k, i32 %l, i32 %m, i32 %n, i32 %o, i32 %p) { entry: %div = sdiv i32 %a, %b @@ -224,10 +251,13 @@ ; CHECK-LABEL: simple_multiple_use: ; CHECK: .param i32, i32{{$}} -; CHECK-NEXT: i32.mul $push[[NUM0:[0-9]+]]=, $1, $0{{$}} -; CHECK-NEXT: tee_local $push[[NUM1:[0-9]+]]=, $[[NUM2:[0-9]+]]=, $pop[[NUM0]]{{$}} -; CHECK-NEXT: call use_a@FUNCTION, $pop[[NUM1]]{{$}} -; CHECK-NEXT: call use_b@FUNCTION, $[[NUM2]]{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.mul +; CHECK-NEXT: tee_local 1{{$}} +; CHECK-NEXT: call use_a@FUNCTION{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: call use_b@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} declare void @use_a(i32) declare void @use_b(i32) @@ -242,9 +272,12 @@ ; CHECK-LABEL: multiple_uses_in_same_insn: ; CHECK: .param i32, i32{{$}} -; CHECK-NEXT: i32.mul $push[[NUM0:[0-9]+]]=, $1, $0{{$}} -; CHECK-NEXT: tee_local $push[[NUM1:[0-9]+]]=, $[[NUM2:[0-9]+]]=, $pop[[NUM0]]{{$}} -; CHECK-NEXT: call use_2@FUNCTION, $pop[[NUM1]], $[[NUM2]]{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.mul +; CHECK-NEXT: tee_local 1{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: call use_2@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} declare void @use_2(i32, i32) define void @multiple_uses_in_same_insn(i32 %x, i32 %y) { @@ -258,12 +291,12 @@ ; CHECK-LABEL: commute: ; CHECK-NOT: param ; CHECK: .result i32{{$}} -; CHECK-NEXT: i32.call $push0=, red@FUNCTION{{$}} -; CHECK-NEXT: i32.call $push1=, green@FUNCTION{{$}} -; CHECK-NEXT: i32.add $push2=, $pop0, $pop1{{$}} -; CHECK-NEXT: i32.call $push3=, blue@FUNCTION{{$}} -; CHECK-NEXT: i32.add $push4=, $pop2, $pop3{{$}} -; CHECK-NEXT: return $pop4{{$}} +; CHECK-NEXT: i32.call red@FUNCTION{{$}} +; CHECK-NEXT: i32.call green@FUNCTION{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.call blue@FUNCTION{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: return{{$}} declare i32 @red() declare i32 @green() declare i32 @blue() @@ -280,13 +313,18 @@ ; an implicit get_local for the register. ; CHECK-LABEL: no_stackify_past_use: -; CHECK: i32.call $1=, callee@FUNCTION, $0 -; CHECK-NEXT: i32.const $push0=, 1 -; CHECK-NEXT: i32.add $push1=, $0, $pop0 -; CHECK-NEXT: i32.call $push2=, callee@FUNCTION, $pop1 -; CHECK-NEXT: i32.sub $push3=, $pop2, $1 -; CHECK-NEXT: i32.div_s $push4=, $pop3, $1 -; CHECK-NEXT: return $pop4 +; CHECK: get_local 0{{$}} +; CHECK-NEXT: i32.call callee@FUNCTION +; CHECK-NEXT: set_local 1{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: i32.const 1 +; CHECK-NEXT: i32.add +; CHECK-NEXT: i32.call callee@FUNCTION +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.sub +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.div_s +; CHECK-NEXT: return declare i32 @callee(i32) define i32 @no_stackify_past_use(i32 %arg) { %tmp1 = call i32 @callee(i32 %arg) @@ -301,14 +339,17 @@ ; so we can reorder the operands and stackify. ; CHECK-LABEL: commute_to_fix_ordering: -; CHECK: i32.call $push[[L0:.+]]=, callee@FUNCTION, $0 -; CHECK: tee_local $push[[L1:.+]]=, $1=, $pop[[L0]] -; CHECK: i32.const $push0=, 1 -; CHECK: i32.add $push1=, $0, $pop0 -; CHECK: i32.call $push2=, callee@FUNCTION, $pop1 -; CHECK: i32.add $push3=, $1, $pop2 -; CHECK: i32.mul $push4=, $pop[[L1]], $pop3 -; CHECK: return $pop4 +; CHECK: get_local 0{{$}} +; CHECK: i32.call callee@FUNCTION +; CHECK: tee_local 1 +; CHECK: get_local 1{{$}} +; CHECK: get_local 0{{$}} +; CHECK: i32.const 1 +; CHECK: i32.add +; CHECK: i32.call callee@FUNCTION +; CHECK: i32.add +; CHECK: i32.mul +; CHECK: return define i32 @commute_to_fix_ordering(i32 %arg) { %tmp1 = call i32 @callee(i32 %arg) %tmp2 = add i32 %arg, 1 @@ -321,10 +362,9 @@ ; Stackify individual defs of virtual registers with multiple defs. ; CHECK-LABEL: multiple_defs: -; CHECK: f64.add $push[[NUM0:[0-9]+]]=, ${{[0-9]+}}, $pop{{[0-9]+}}{{$}} -; CHECK-NEXT: tee_local $push[[NUM1:[0-9]+]]=, $[[NUM2:[0-9]+]]=, $pop[[NUM0]]{{$}} -; CHECK-NEXT: f64.select $push{{[0-9]+}}=, $pop{{[0-9]+}}, $pop[[NUM1]], ${{[0-9]+}}{{$}} -; CHECK: $[[NUM2]]=, +; CHECK: f64.add +; CHECK: tee_local +; CHECK: f64.select define void @multiple_defs(i32 %arg, i32 %arg1, i1 %arg2, i1 %arg3, i1 %arg4) { bb: br label %bb5 @@ -364,9 +404,9 @@ ; Don't move calls past loads ; CHECK-LABEL: no_stackify_call_past_load: -; CHECK: i32.call $0=, red -; CHECK: i32.const $push0=, 0 -; CHECK: i32.load $1=, count($pop0) +; CHECK: i32.call red +; CHECK: i32.const 0 +; CHECK: i32.load count @count = hidden global i32 0, align 4 define i32 @no_stackify_call_past_load() { %a = call i32 @red() @@ -378,9 +418,9 @@ ; Don't move stores past loads if there may be aliasing ; CHECK-LABEL: no_stackify_store_past_load -; CHECK: i32.store 0($1), $0 -; CHECK: i32.load {{.*}}, 0($2) -; CHECK: i32.call {{.*}}, callee@FUNCTION, $0{{$}} +; CHECK: i32.store 0 +; CHECK: i32.load 0 +; CHECK: i32.call callee@FUNCTION{{$}} define i32 @no_stackify_store_past_load(i32 %a, i32* %p1, i32* %p2) { store i32 %a, i32* %p1 %b = load i32, i32* %p2, align 4 @@ -390,10 +430,10 @@ ; Can still stackify past invariant loads. ; CHECK-LABEL: store_past_invar_load -; CHECK: i32.store 0($1), $0 -; CHECK: i32.call {{.*}}, callee@FUNCTION, $0 -; CHECK: i32.load $push{{.*}}, 0($2) -; CHECK: return $pop +; CHECK: i32.store 0 +; CHECK: i32.call callee@FUNCTION +; CHECK: i32.load 0 +; CHECK: return define i32 @store_past_invar_load(i32 %a, i32* %p1, i32* dereferenceable(4) %p2) { store i32 %a, i32* %p1 %b = load i32, i32* %p2, !invariant.load !0 @@ -414,7 +454,7 @@ ; might insert a prologue before the return. ; CHECK-LABEL: no_stackify_past_epilogue: -; CHECK: return ${{[0-9]+}}{{$}} +; CHECK: return{{$}} declare i32 @use_memory(i32*) define i32 @no_stackify_past_epilogue() { %x = alloca i32 @@ -425,10 +465,10 @@ ; Stackify a loop induction variable into a loop comparison. ; CHECK-LABEL: stackify_indvar: -; CHECK: i32.const $push[[L5:.+]]=, 1{{$}} -; CHECK-NEXT: i32.add $push[[L4:.+]]=, $[[R0:.+]], $pop[[L5]]{{$}} -; CHECK-NEXT: tee_local $push[[L3:.+]]=, $[[R0]]=, $pop[[L4]]{{$}} -; CHECK-NEXT: i32.ne $push[[L2:.+]]=, $0, $pop[[L3]]{{$}} +; CHECK: i32.const 1{{$}} +; CHECK-NEXT: i32.add +; CHECK-NEXT: tee_local 2{{$}} +; CHECK-NEXT: i32.ne define void @stackify_indvar(i32 %tmp, i32* %v) #0 { bb: br label %bb3 @@ -449,8 +489,8 @@ ; Don't stackify a call past a __stack_pointer store. ; CHECK-LABEL: stackpointer_dependency: -; CHECK: call {{.+}}, stackpointer_callee@FUNCTION, -; CHECK-NEXT: set_global __stack_pointer, +; CHECK: call stackpointer_callee@FUNCTION +; CHECK: set_global __stack_pointer declare i32 @stackpointer_callee(i8* readnone, i8* readnone) declare i8* @llvm.frameaddress(i32) define i32 @stackpointer_dependency(i8* readnone) { @@ -462,11 +502,11 @@ ; Stackify a call_indirect with respect to its ordering ; CHECK-LABEL: call_indirect_stackify: -; CHECK: i32.load $push[[L4:.+]]=, 0($0) -; CHECK-NEXT: tee_local $push[[L3:.+]]=, $0=, $pop[[L4]] -; CHECK-NEXT: i32.load $push[[L0:.+]]=, 0($0) -; CHECK-NEXT: i32.load $push[[L1:.+]]=, 0($pop[[L0]]) -; CHECK-NEXT: i32.call_indirect $push{{.+}}=, $pop[[L3]], $1, $pop[[L1]] +; CHECK: i32.load 0 +; CHECK-NEXT: tee_local 0 +; CHECK: i32.load 0 +; CHECK-NEXT: i32.load 0 +; CHECK-NEXT: i32.call_indirect %class.call_indirect = type { i32 (...)** } define i32 @call_indirect_stackify(%class.call_indirect** %objptr, i32 %arg) { %obj = load %class.call_indirect*, %class.call_indirect** %objptr Index: test/CodeGen/WebAssembly/return-int32.ll =================================================================== --- test/CodeGen/WebAssembly/return-int32.ll +++ test/CodeGen/WebAssembly/return-int32.ll @@ -7,7 +7,7 @@ ; CHECK-LABEL: return_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: get_local $push0=, 0 +; CHECK-NEXT: get_local 0 ; CHECK-NEXT: end_function{{$}} define i32 @return_i32(i32 %p) { ret i32 %p @@ -15,10 +15,10 @@ ; CHECK-LABEL: return_i32_twice: ; CHECK: store -; CHECK-NEXT: i32.const $push[[L0:[^,]+]]=, 1{{$}} -; CHECK-NEXT: return $pop[[L0]]{{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: return{{$}} ; CHECK: store -; CHECK-NEXT: i32.const $push{{[^,]+}}=, 3{{$}} +; CHECK-NEXT: i32.const 3{{$}} ; CHECK-NEXT: end_function{{$}} define i32 @return_i32_twice(i32 %a) { %b = icmp ne i32 %a, 0 @@ -26,7 +26,7 @@ true: store i32 0, i32* null - ret i32 1 + ret i32 1 false: store i32 2, i32* null Index: test/CodeGen/WebAssembly/returned.ll =================================================================== --- test/CodeGen/WebAssembly/returned.ll +++ test/CodeGen/WebAssembly/returned.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test that the "returned" attribute is optimized effectively. @@ -7,10 +7,10 @@ ; CHECK-LABEL: _Z3foov: ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push0=, 1{{$}} -; CHECK-NEXT: {{^}} i32.call $push1=, _Znwm@FUNCTION, $pop0{{$}} -; CHECK-NEXT: {{^}} i32.call $push2=, _ZN5AppleC1Ev@FUNCTION, $pop1{{$}} -; CHECK-NEXT: return $pop2{{$}} +; CHECK-NEXT: i32.const 1{{$}} +; CHECK-NEXT: {{^}} i32.call _Znwm@FUNCTION{{$}} +; CHECK-NEXT: {{^}} i32.call _ZN5AppleC1Ev@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} %class.Apple = type { i8 } declare noalias i8* @_Znwm(i32) declare %class.Apple* @_ZN5AppleC1Ev(%class.Apple* returned) @@ -25,8 +25,8 @@ ; CHECK-LABEL: _Z3barPvS_l: ; CHECK-NEXT: .param i32, i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: {{^}} i32.call $push0=, memcpy@FUNCTION, $0, $1, $2{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: {{^}} i32.call memcpy@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} declare i8* @memcpy(i8* returned, i8*, i32) define i8* @_Z3barPvS_l(i8* %p, i8* %s, i32 %n) { entry: @@ -37,8 +37,8 @@ ; Test that the optimization isn't performed on constant arguments. ; CHECK-LABEL: test_constant_arg: -; CHECK-NEXT: i32.const $push0=, global{{$}} -; CHECK-NEXT: {{^}} i32.call $drop=, returns_arg@FUNCTION, $pop0{{$}} +; CHECK-NEXT: i32.const global{{$}} +; CHECK-NEXT: {{^}} i32.call returns_arg@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} @global = external global i32 @addr = global i32* @global @@ -53,9 +53,9 @@ ; CHECK-LABEL: test_other_skipped: ; CHECK-NEXT: .param i32, i32, f64{{$}} -; CHECK-NEXT: {{^}} i32.call $drop=, do_something@FUNCTION, $0, $1, $2{{$}} -; CHECK-NEXT: {{^}} call do_something_with_i32@FUNCTION, $1{{$}} -; CHECK-NEXT: {{^}} call do_something_with_double@FUNCTION, $2{{$}} +; CHECK-NEXT: {{^}} i32.call do_something@FUNCTION{{$}} +; CHECK-NEXT: {{^}} call do_something_with_i32@FUNCTION{{$}} +; CHECK-NEXT: {{^}} call do_something_with_double@FUNCTION{{$}} declare i32 @do_something(i32 returned, i32, double) declare void @do_something_with_i32(i32) declare void @do_something_with_double(double) @@ -71,8 +71,8 @@ ; CHECK-LABEL: test_second_arg: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: {{^}} i32.call $push0=, do_something_else@FUNCTION, $0, $1{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: {{^}} i32.call do_something_else@FUNCTION{{$}} +; CHECK-NEXT: return {{$}} declare i32 @do_something_else(i32, i32 returned) define i32 @test_second_arg(i32 %a, i32 %b) { %call = call i32 @do_something_else(i32 %a, i32 %b) Index: test/CodeGen/WebAssembly/select.ll =================================================================== --- test/CodeGen/WebAssembly/select.ll +++ test/CodeGen/WebAssembly/select.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -fast-isel -fast-isel-abort=1 | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -fast-isel -fast-isel-abort=1 | FileCheck %s ; Test that wasm select instruction is selected from LLVM select instruction. @@ -9,8 +9,8 @@ ; CHECK-LABEL: select_i32_bool: ; CHECK-NEXT: .param i32, i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.select +; CHECK-NEXT: return {{$}} define i32 @select_i32_bool(i1 zeroext %a, i32 %b, i32 %c) { %cond = select i1 %a, i32 %b, i32 %c ret i32 %cond @@ -19,8 +19,8 @@ ; CHECK-LABEL: select_i32_eq: ; CHECK-NEXT: .param i32, i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.select $push0=, $2, $1, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.select +; CHECK-NEXT: return {{$}} define i32 @select_i32_eq(i32 %a, i32 %b, i32 %c) { %cmp = icmp eq i32 %a, 0 %cond = select i1 %cmp, i32 %b, i32 %c @@ -30,8 +30,8 @@ ; CHECK-LABEL: select_i32_ne: ; CHECK-NEXT: .param i32, i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i32.select +; CHECK-NEXT: return {{$}} define i32 @select_i32_ne(i32 %a, i32 %b, i32 %c) { %cmp = icmp ne i32 %a, 0 %cond = select i1 %cmp, i32 %b, i32 %c @@ -41,8 +41,8 @@ ; CHECK-LABEL: select_i64_bool: ; CHECK-NEXT: .param i32, i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i64.select +; CHECK-NEXT: return {{$}} define i64 @select_i64_bool(i1 zeroext %a, i64 %b, i64 %c) { %cond = select i1 %a, i64 %b, i64 %c ret i64 %cond @@ -51,8 +51,8 @@ ; CHECK-LABEL: select_i64_eq: ; CHECK-NEXT: .param i32, i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.select $push0=, $2, $1, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i64.select +; CHECK-NEXT: return {{$}} define i64 @select_i64_eq(i32 %a, i64 %b, i64 %c) { %cmp = icmp eq i32 %a, 0 %cond = select i1 %cmp, i64 %b, i64 %c @@ -62,8 +62,8 @@ ; CHECK-LABEL: select_i64_ne: ; CHECK-NEXT: .param i32, i64, i64{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: i64.select +; CHECK-NEXT: return {{$}} define i64 @select_i64_ne(i32 %a, i64 %b, i64 %c) { %cmp = icmp ne i32 %a, 0 %cond = select i1 %cmp, i64 %b, i64 %c @@ -73,8 +73,8 @@ ; CHECK-LABEL: select_f32_bool: ; CHECK-NEXT: .param i32, f32, f32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: f32.select +; CHECK-NEXT: return {{$}} define float @select_f32_bool(i1 zeroext %a, float %b, float %c) { %cond = select i1 %a, float %b, float %c ret float %cond @@ -83,8 +83,8 @@ ; CHECK-LABEL: select_f32_eq: ; CHECK-NEXT: .param i32, f32, f32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.select $push0=, $2, $1, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: f32.select +; CHECK-NEXT: return {{$}} define float @select_f32_eq(i32 %a, float %b, float %c) { %cmp = icmp eq i32 %a, 0 %cond = select i1 %cmp, float %b, float %c @@ -94,8 +94,8 @@ ; CHECK-LABEL: select_f32_ne: ; CHECK-NEXT: .param i32, f32, f32{{$}} ; CHECK-NEXT: .result f32{{$}} -; CHECK-NEXT: f32.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: f32.select +; CHECK-NEXT: return {{$}} define float @select_f32_ne(i32 %a, float %b, float %c) { %cmp = icmp ne i32 %a, 0 %cond = select i1 %cmp, float %b, float %c @@ -105,8 +105,8 @@ ; CHECK-LABEL: select_f64_bool: ; CHECK-NEXT: .param i32, f64, f64{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: f64.select +; CHECK-NEXT: return {{$}} define double @select_f64_bool(i1 zeroext %a, double %b, double %c) { %cond = select i1 %a, double %b, double %c ret double %cond @@ -115,8 +115,8 @@ ; CHECK-LABEL: select_f64_eq: ; CHECK-NEXT: .param i32, f64, f64{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.select $push0=, $2, $1, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: f64.select +; CHECK-NEXT: return {{$}} define double @select_f64_eq(i32 %a, double %b, double %c) { %cmp = icmp eq i32 %a, 0 %cond = select i1 %cmp, double %b, double %c @@ -126,8 +126,8 @@ ; CHECK-LABEL: select_f64_ne: ; CHECK-NEXT: .param i32, f64, f64{{$}} ; CHECK-NEXT: .result f64{{$}} -; CHECK-NEXT: f64.select $push0=, $1, $2, $0{{$}} -; CHECK-NEXT: return $pop0{{$}} +; CHECK-NEXT: f64.select +; CHECK-NEXT: return {{$}} define double @select_f64_ne(i32 %a, double %b, double %c) { %cmp = icmp ne i32 %a, 0 %cond = select i1 %cmp, double %b, double %c Index: test/CodeGen/WebAssembly/signext-arg.ll =================================================================== --- test/CodeGen/WebAssembly/signext-arg.ll +++ test/CodeGen/WebAssembly/signext-arg.ll @@ -1,5 +1,5 @@ ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false | FileCheck %s target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" @@ -8,11 +8,11 @@ define i32 @func_1(i16 %arg1 , i32 %arg2) #0 { ; CHECK-LABEL: func_1: -; CHECK: i32.const $push1=, 16 -; CHECK-NEXT: i32.shl $push2=, $0, $pop1 -; CHECK-NEXT: i32.const $push4=, 16 -; CHECK-NEXT: i32.shr_s $push3=, $pop2, $pop4 -; CHECK-NEXT: i32.call $push0=, get_int@FUNCTION, $pop3 +; CHECK: i32.const 16 +; CHECK-NEXT: i32.shl $0 +; CHECK-NEXT: i32.const 16 +; CHECK-NEXT: i32.shr_s +; CHECK-NEXT: i32.call get_int@FUNCTION ; CHECK-NEXT: end_function entry: %retval = call i32 @get_int(i16 signext %arg1) Index: test/CodeGen/WebAssembly/signext-inreg.ll =================================================================== --- test/CodeGen/WebAssembly/signext-inreg.ll +++ test/CodeGen/WebAssembly/signext-inreg.ll @@ -1,5 +1,5 @@ -; RUN: llc < %s -mattr=+sign-ext -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s --check-prefix=NOSIGNEXT +; RUN: llc < %s -mattr=+sign-ext -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s --check-prefix=NOSIGNEXT target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" @@ -7,8 +7,8 @@ ; CHECK-LABEL: i32_extend8_s: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.extend8_s $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.extend8_s +; CHECK-NEXT: return{{$}} ; NOSIGNEXT-LABEL: i32_extend8_s ; NOSIGNEXT-NOT: i32.extend8_s @@ -20,8 +20,8 @@ ; CHECK-LABEL: i32_extend16_s: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.extend16_s $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i32.extend16_s +; CHECK-NEXT: return{{$}} ; NOSIGNEXT-LABEL: i32_extend16_s ; NOSIGNEXT-NOT: i32.extend16_s @@ -33,9 +33,9 @@ ; CHECK-LABEL: i64_extend8_s: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.extend_u/i32 $push[[NUM1:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: i64.extend8_s $push[[NUM2:[0-9]+]]=, $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: i64.extend_u/i32 +; CHECK-NEXT: i64.extend8_s{{$}} +; CHECK-NEXT: return{{$}} ; NOSIGNEXT-LABEL: i64_extend8_s ; NOSIGNEXT-NOT: i64.extend8_s @@ -47,9 +47,9 @@ ; CHECK-LABEL: i64_extend16_s: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.extend_u/i32 $push[[NUM1:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: i64.extend16_s $push[[NUM2:[0-9]+]]=, $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: i64.extend_u/i32 +; CHECK-NEXT: i64.extend16_s{{$}} +; CHECK-NEXT: return{{$}} ; NOSIGNEXT-LABEL: i64_extend16_s ; NOSIGNEXT-NOT: i16.extend16_s @@ -62,8 +62,8 @@ ; CHECK-LABEL: i64_extend32_s: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i64{{$}} -; CHECK-NEXT: i64.extend_s/i32 $push[[NUM:[0-9]+]]=, $0{{$}} -; CHECK-NEXT: return $pop[[NUM]]{{$}} +; CHECK-NEXT: i64.extend_s/i32 +; CHECK-NEXT: return{{$}} define i64 @i64_extend32_s(i32 %x) { %a = sext i32 %x to i64 ret i64 %a Index: test/CodeGen/WebAssembly/signext-zeroext.ll =================================================================== --- test/CodeGen/WebAssembly/signext-zeroext.ll +++ test/CodeGen/WebAssembly/signext-zeroext.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Test zeroext and signext ABI keywords @@ -8,11 +8,11 @@ ; CHECK-LABEL: z2s_func: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM0:[0-9]+]]=, 24{{$}} -; CHECK-NEXT: i32.shl $push[[NUM2:[0-9]+]]=, $0, $pop[[NUM0]]{{$}} -; CHECK-NEXT: i32.const $push[[NUM1:[0-9]+]]=, 24{{$}} -; CHECK-NEXT: i32.shr_s $push[[NUM3:[0-9]+]]=, $pop[[NUM2]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM3]]{{$}} +; CHECK-NEXT: i32.const 24{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.const 24{{$}} +; CHECK-NEXT: i32.shr_s{{$}} +; CHECK-NEXT: return{{$}} define signext i8 @z2s_func(i8 zeroext %t) { ret i8 %t } @@ -20,9 +20,9 @@ ; CHECK-LABEL: s2z_func: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM0:[0-9]+]]=, 255{{$}} -; CHECK-NEXT: i32.and $push[[NUM1:[0-9]+]]=, $0, $pop[[NUM0]]{{$}} -; CHECK-NEXT: return $pop[[NUM1]]{{$}} +; CHECK-NEXT: i32.const 255{{$}} +; CHECK-NEXT: i32.and +; CHECK-NEXT: return{{$}} define zeroext i8 @s2z_func(i8 signext %t) { ret i8 %t } @@ -30,10 +30,10 @@ ; CHECK-LABEL: z2s_call: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM0:[0-9]+]]=, 255{{$}} -; CHECK-NEXT: i32.and $push[[NUM1:[0-9]+]]=, $0, $pop[[NUM0]]{{$}} -; CHECK-NEXT: call $push[[NUM2:[0-9]+]]=, z2s_func@FUNCTION, $pop[[NUM1]]{{$}} -; CHECK-NEXT: return $pop[[NUM2]]{{$}} +; CHECK-NEXT: i32.const 255{{$}} +; CHECK-NEXT: i32.and +; CHECK-NEXT: call z2s_func@FUNCTION{{$}} +; CHECK-NEXT: return{{$}} define i32 @z2s_call(i32 %t) { %s = trunc i32 %t to i8 %u = call signext i8 @z2s_func(i8 zeroext %s) @@ -44,16 +44,16 @@ ; CHECK-LABEL: s2z_call: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.const $push[[NUM0:[0-9]+]]=, 24{{$}} -; CHECK-NEXT: i32.shl $push[[NUM1:[0-9]+]]=, $0, $pop[[NUM0]]{{$}} -; CHECK-NEXT: i32.const $push[[NUM6:[0-9]+]]=, 24{{$}} -; CHECK-NEXT: i32.shr_s $push[[NUM2:[0-9]+]]=, $pop[[NUM1]], $pop[[NUM6]]{{$}} -; CHECK-NEXT: call $push[[NUM3:[0-9]]]=, s2z_func@FUNCTION, $pop[[NUM2]]{{$}} -; CHECK-NEXT: i32.const $push[[NUM7:[0-9]+]]=, 24{{$}} -; CHECK-NEXT: i32.shl $push[[NUM4:[0-9]+]]=, $pop[[NUM3]], $pop[[NUM7]]{{$}} -; CHECK-NEXT: i32.const $push[[NUM8:[0-9]+]]=, 24{{$}} -; CHECK-NEXT: i32.shr_s $push[[NUM5:[0-9]+]]=, $pop[[NUM4]], $pop[[NUM8]]{{$}} -; CHECK-NEXT: return $pop[[NUM5]]{{$}} +; CHECK-NEXT: i32.const 24{{$}} +; CHECK-NEXT: i32.shl +; CHECK-NEXT: i32.const 24{{$}} +; CHECK-NEXT: i32.shr_s{{$}} +; CHECK-NEXT: call s2z_func@FUNCTION{{$}} +; CHECK-NEXT: i32.const 24{{$}} +; CHECK-NEXT: i32.shl{{$}} +; CHECK-NEXT: i32.const 24{{$}} +; CHECK-NEXT: i32.shr_s{{$}} +; CHECK-NEXT: return{{$}} define i32 @s2z_call(i32 %t) { %s = trunc i32 %t to i8 %u = call zeroext i8 @s2z_func(i8 signext %s) Index: test/CodeGen/WebAssembly/simd-arith.ll =================================================================== --- test/CodeGen/WebAssembly/simd-arith.ll +++ test/CodeGen/WebAssembly/simd-arith.ll @@ -1,7 +1,7 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -mattr=+simd128 | FileCheck %s --check-prefixes CHECK,SIMD128 -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -mattr=+simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,SIMD128 -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -mattr=-simd128 | FileCheck %s --check-prefixes CHECK,NO-SIMD128 -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -mattr=-simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,NO-SIMD128 +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -mattr=+simd128 | FileCheck %s --check-prefixes CHECK,SIMD128 +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -mattr=+simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,SIMD128 +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -mattr=-simd128 | FileCheck %s --check-prefixes CHECK,NO-SIMD128 +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -mattr=-simd128 -fast-isel | FileCheck %s --check-prefixes CHECK,NO-SIMD128 ; Test that basic SIMD128 arithmetic operations assemble as expected. @@ -19,8 +19,8 @@ ; NO-SIMD128-NOT: i8x16 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i8x16.add $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i8x16.add +; SIMD128: return{{$}} define <16 x i8> @add_v16i8(<16 x i8> %x, <16 x i8> %y) { %a = add <16 x i8> %x, %y ret <16 x i8> %a @@ -30,8 +30,8 @@ ; NO-SIMD128-NOT: i8x16 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i8x16.sub $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i8x16.sub +; SIMD128: return{{$}} define <16 x i8> @sub_v16i8(<16 x i8> %x, <16 x i8> %y) { %a = sub <16 x i8> %x, %y ret <16 x i8> %a @@ -41,8 +41,8 @@ ; NO-SIMD128-NOT: i8x16 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i8x16.mul $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i8x16.mul +; SIMD128: return{{$}} define <16 x i8> @mul_v16i8(<16 x i8> %x, <16 x i8> %y) { %a = mul <16 x i8> %x, %y ret <16 x i8> %a @@ -55,8 +55,8 @@ ; NO-SIMD128-NOT: i16x8 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i16x8.add $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i16x8.add +; SIMD128: return{{$}} define <8 x i16> @add_v8i16(<8 x i16> %x, <8 x i16> %y) { %a = add <8 x i16> %x, %y ret <8 x i16> %a @@ -66,8 +66,8 @@ ; NO-SIMD128-NOT: i16x8 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i16x8.sub $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i16x8.sub +; SIMD128: return{{$}} define <8 x i16> @sub_v8i16(<8 x i16> %x, <8 x i16> %y) { %a = sub <8 x i16> %x, %y ret <8 x i16> %a @@ -77,8 +77,8 @@ ; NO-SIMD128-NOT: i16x8 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i16x8.mul $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i16x8.mul +; SIMD128: return{{$}} define <8 x i16> @mul_v8i16(<8 x i16> %x, <8 x i16> %y) { %a = mul <8 x i16> %x, %y ret <8 x i16> %a @@ -91,8 +91,8 @@ ; NO-SIMD128-NOT: i32x4 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i32x4.add $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i32x4.add +; SIMD128: return{{$}} define <4 x i32> @add_v4i32(<4 x i32> %x, <4 x i32> %y) { %a = add <4 x i32> %x, %y ret <4 x i32> %a @@ -102,8 +102,8 @@ ; NO-SIMD128-NOT: i32x4 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i32x4.sub $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i32x4.sub +; SIMD128: return{{$}} define <4 x i32> @sub_v4i32(<4 x i32> %x, <4 x i32> %y) { %a = sub <4 x i32> %x, %y ret <4 x i32> %a @@ -113,8 +113,8 @@ ; NO-SIMD128-NOT: i32x4 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: i32x4.mul $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: i32x4.mul +; SIMD128: return{{$}} define <4 x i32> @mul_v4i32(<4 x i32> %x, <4 x i32> %y) { %a = mul <4 x i32> %x, %y ret <4 x i32> %a @@ -127,8 +127,8 @@ ; NO-SIMD128-NOT: f32x4 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: f32x4.add $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: f32x4.add +; SIMD128: return{{$}} define <4 x float> @add_v4f32(<4 x float> %x, <4 x float> %y) { %a = fadd <4 x float> %x, %y ret <4 x float> %a @@ -138,8 +138,8 @@ ; NO-SIMD128-NOT: f32x4 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: f32x4.sub $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: f32x4.sub +; SIMD128: return{{$}} define <4 x float> @sub_v4f32(<4 x float> %x, <4 x float> %y) { %a = fsub <4 x float> %x, %y ret <4 x float> %a @@ -149,8 +149,8 @@ ; NO-SIMD128-NOT: f32x4 ; SIMD128: .param v128, v128{{$}} ; SIMD128: .result v128{{$}} -; SIMD128: f32x4.mul $push0=, $0, $1{{$}} -; SIMD128: return $pop0{{$}} +; SIMD128: f32x4.mul +; SIMD128: return{{$}} define <4 x float> @mul_v4f32(<4 x float> %x, <4 x float> %y) { %a = fmul <4 x float> %x, %y ret <4 x float> %a Index: test/CodeGen/WebAssembly/stack-alignment.ll =================================================================== --- test/CodeGen/WebAssembly/stack-alignment.ll +++ test/CodeGen/WebAssembly/stack-alignment.ll @@ -6,18 +6,18 @@ declare void @somefunc(i32*) ; CHECK-LABEL: underalign: -; CHECK: get_global $push[[L1:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: i32.const $push[[L2:.+]]=, 16 -; CHECK-NEXT: i32.sub $push[[L10:.+]]=, $pop[[L1]], $pop[[L2]] -; CHECK-NEXT: tee_local $push{{.+}}=, [[SP:.+]], $pop[[L10]] - -; CHECK: get_local $push[[L3:.+]]=, [[SP]]{{$}} -; CHECK: i32.add $push[[underaligned:.+]]=, $pop[[L3]], $pop{{.+}} -; CHECK-NEXT: call somefunc@FUNCTION, $pop[[underaligned]] - -; CHECK: get_local $push[[M4:.+]]=, [[SP]]{{$}} -; CHECK: i32.add $push[[L5:.+]]=, $pop[[M4]], $pop{{.+}} -; CHECK-NEXT: set_global __stack_pointer, $pop[[L5]] +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: i32.const 16 +; CHECK-NEXT: i32.sub +; CHECK-NEXT: tee_local [[SP:.+]] + +; CHECK: get_local [[SP]]{{$}} +; CHECK: i32.add +; CHECK-NEXT: call somefunc@FUNCTION + +; CHECK: get_local [[SP]]{{$}} +; CHECK: i32.add +; CHECK-NEXT: set_global __stack_pointer define void @underalign() { entry: %underaligned = alloca i32, align 8 @@ -26,19 +26,19 @@ } ; CHECK-LABEL: overalign: -; CHECK: get_global $push[[L10:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: tee_local $push[[L9:.+]]=, [[BP:.+]], $pop[[L10]] -; CHECK-NEXT: i32.const $push[[L2:.+]]=, 32 -; CHECK-NEXT: i32.sub $push[[L8:.+]]=, $pop[[L9]], $pop[[L2]] -; CHECK-NEXT: i32.const $push[[L3:.+]]=, -32 -; CHECK-NEXT: i32.and $push[[L7:.+]]=, $pop[[L8]], $pop[[L3]] -; CHECK-NEXT: tee_local $push{{.+}}=, [[SP:.+]], $pop[[L7]] - -; CHECK: get_local $push[[M5:.+]]=, [[SP]]{{$}} -; CHECK: call somefunc@FUNCTION, $pop[[M5]]{{$}} - -; CHECK: get_local $push[[M6:.+]]=, [[BP]]{{$}} -; CHECK-NEXT: set_global __stack_pointer, $pop[[M6]] +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: tee_local [[BP:.+]] +; CHECK-NEXT: i32.const 32 +; CHECK-NEXT: i32.sub +; CHECK-NEXT: i32.const -32 +; CHECK-NEXT: i32.and +; CHECK-NEXT: tee_local [[SP:.+]] + +; CHECK: get_local [[SP]]{{$}} +; CHECK: call somefunc@FUNCTION{{$}} + +; CHECK: get_local [[BP]]{{$}} +; CHECK-NEXT: set_global __stack_pointer define void @overalign() { entry: %overaligned = alloca i32, align 32 @@ -47,21 +47,21 @@ } ; CHECK-LABEL: over_and_normal_align: -; CHECK: get_global $push[[L14:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: tee_local $push[[L13:.+]]=, [[BP:.+]], $pop[[L14]] -; CHECK: i32.sub $push[[L12:.+]]=, $pop[[L13]], $pop{{.+}} -; CHECK: i32.and $push[[L11:.+]]=, $pop[[L12]], $pop{{.+}} -; CHECK-NEXT: tee_local $push{{.+}}=, [[SP:.+]], $pop[[L11]] - -; CHECK: get_local $push[[M6:.+]]=, [[SP]]{{$}} -; CHECK: i32.add $push[[L6:.+]]=, $pop[[M6]], $pop{{.+}} -; CHECK-NEXT: call somefunc@FUNCTION, $pop[[L6]] -; CHECK: get_local $push[[M7:.+]]=, [[SP]]{{$}} -; CHECK: i32.add $push[[L8:.+]]=, $pop[[M7]], $pop{{.+}} -; CHECK-NEXT: call somefunc@FUNCTION, $pop[[L8]] - -; CHECK: get_local $push[[L6:.+]]=, [[BP]]{{$}} -; CHECK-NEXT: set_global __stack_pointer, $pop[[L6]] +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: tee_local [[BP:.+]] +; CHECK: i32.sub +; CHECK: i32.and +; CHECK-NEXT: tee_local [[SP:.+]] + +; CHECK: get_local [[SP]]{{$}} +; CHECK: i32.add +; CHECK-NEXT: call somefunc@FUNCTION +; CHECK: get_local [[SP]]{{$}} +; CHECK: i32.add +; CHECK-NEXT: call somefunc@FUNCTION + +; CHECK: get_local [[BP]]{{$}} +; CHECK-NEXT: set_global __stack_pointer define void @over_and_normal_align() { entry: %over = alloca i32, align 32 @@ -72,16 +72,16 @@ } ; CHECK-LABEL: dynamic_overalign: -; CHECK: get_global $push[[L18:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: tee_local $push[[L17:.+]]=, [[SP:.+]], $pop[[L18]] -; CHECK-NEXT: set_local [[BP:.+]], $pop[[L17]] -; CHECK: tee_local $push{{.+}}=, [[SP_2:.+]], $pop{{.+}} +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: tee_local [[SP:.+]] +; CHECK-NEXT: set_local [[BP:.+]] +; CHECK: tee_local [[SP_2:.+]] -; CHECK: get_local $push[[M8:.+]]=, [[SP_2]]{{$}} -; CHECK: call somefunc@FUNCTION, $pop[[M8]] +; CHECK: get_local [[SP_2]]{{$}} +; CHECK: call somefunc@FUNCTION -; CHECK: get_local $push[[M9:.+]]=, [[BP]]{{$}} -; CHECK-NEXT: set_global __stack_pointer, $pop[[M9]] +; CHECK: get_local [[BP]]{{$}} +; CHECK-NEXT: set_global __stack_pointer define void @dynamic_overalign(i32 %num) { entry: %dynamic = alloca i32, i32 %num, align 32 @@ -90,22 +90,22 @@ } ; CHECK-LABEL: overalign_and_dynamic: -; CHECK: get_global $push[[L21:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: tee_local $push[[L20:.+]]=, [[BP:.+]], $pop[[L21]] -; CHECK: i32.sub $push[[L19:.+]]=, $pop[[L20]], $pop{{.+}} -; CHECK: i32.and $push[[L18:.+]]=, $pop[[L19]], $pop{{.+}} -; CHECK: tee_local $push{{.+}}=, [[FP:.+]], $pop[[L18]] -; CHECK: get_local $push[[M10:.+]]=, [[FP]]{{$}} -; CHECK: i32.sub $push[[L16:.+]]=, $pop[[M10]], $pop{{.+}} -; CHECK-NEXT: tee_local $push{{.+}}=, [[SP:.+]], $pop[[L16]] - -; CHECK: get_local $push[[over:.+]]=, [[FP]] -; CHECK-NEXT: call somefunc@FUNCTION, $pop[[over]] -; CHECK: get_local $push[[another:.+]]=, [[SP]] -; CHECK-NEXT: call somefunc@FUNCTION, $pop[[another]] - -; CHECK: get_local $push[[M11:.+]]=, [[BP]]{{$}} -; CHECK-NEXT: set_global __stack_pointer, $pop[[M11]] +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: tee_local [[BP:.+]] +; CHECK: i32.sub +; CHECK: i32.and +; CHECK: tee_local [[FP:.+]] +; CHECK: get_local [[FP]]{{$}} +; CHECK: i32.sub +; CHECK-NEXT: tee_local [[SP:.+]] + +; CHECK: get_local [[FP]] +; CHECK-NEXT: call somefunc@FUNCTION +; CHECK: get_local [[SP]] +; CHECK-NEXT: call somefunc@FUNCTION + +; CHECK: get_local [[BP]]{{$}} +; CHECK-NEXT: set_global __stack_pointer define void @overalign_and_dynamic(i32 %num) { entry: %over = alloca i32, align 32 @@ -116,27 +116,27 @@ } ; CHECK-LABEL: overalign_static_and_dynamic: -; CHECK: get_global $push[[L26:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: tee_local $push[[L25:.+]]=, [[BP:.+]], $pop[[L26]] -; CHECK: i32.sub $push[[L24:.+]]=, $pop[[L25]], $pop{{.+}} -; CHECK: i32.and $push[[L23:.+]]=, $pop[[L24]], $pop{{.+}} -; CHECK: tee_local $push{{.+}}=, [[FP:.+]], $pop[[L23]] -; CHECK: get_local $push[[M12:.+]]=, [[FP]]{{$}} -; CHECK: i32.sub $push[[L21:.+]]=, $pop[[M12]], $pop{{.+}} -; CHECK-NEXT: tee_local $push{{.+}}=, [[SP:.+]], $pop[[L21]] - -; CHECK: get_local $push[[L19:.+]]=, [[FP]] -; CHECK: tee_local $push[[L18:.+]]=, [[FP_2:.+]], $pop[[L19]] -; CHECK: i32.add $push[[over:.+]]=, $pop[[L18]], $pop{{.+}} -; CHECK-NEXT: call somefunc@FUNCTION, $pop[[over]] -; CHECK: get_local $push[[M12:.+]]=, [[SP]] -; CHECK: call somefunc@FUNCTION, $pop[[M12]] -; CHECK: get_local $push[[M13:.+]]=, [[FP_2]] -; CHECK: i32.add $push[[static:.+]]=, $pop[[M13]], $pop{{.+}} -; CHECK-NEXT: call somefunc@FUNCTION, $pop[[static]] - -; CHECK: get_local $push[[M14:.+]]=, [[BP]]{{$}} -; CHECK-NEXT: set_global __stack_pointer, $pop[[M14]] +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: tee_local [[BP:.+]] +; CHECK: i32.sub +; CHECK: i32.and +; CHECK: tee_local [[FP:.+]] +; CHECK: get_local [[FP]]{{$}} +; CHECK: i32.sub +; CHECK-NEXT: tee_local [[SP:.+]] + +; CHECK: get_local [[FP]] +; CHECK: tee_local [[FP_2:.+]] +; CHECK: i32.add +; CHECK-NEXT: call somefunc@FUNCTION +; CHECK: get_local [[SP]] +; CHECK: call somefunc@FUNCTION +; CHECK: get_local [[FP_2]] +; CHECK: i32.add +; CHECK-NEXT: call somefunc@FUNCTION + +; CHECK: get_local [[BP]]{{$}} +; CHECK-NEXT: set_global __stack_pointer define void @overalign_static_and_dynamic(i32 %num) { entry: %over = alloca i32, align 32 Index: test/CodeGen/WebAssembly/store-trunc-atomic.ll =================================================================== --- test/CodeGen/WebAssembly/store-trunc-atomic.ll +++ test/CodeGen/WebAssembly/store-trunc-atomic.ll @@ -6,7 +6,7 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: trunc_i8_i32: -; CHECK: i32.atomic.store8 0($0), $1{{$}} +; CHECK: i32.atomic.store8 0{{$}} define void @trunc_i8_i32(i8 *%p, i32 %v) { %t = trunc i32 %v to i8 store atomic i8 %t, i8* %p seq_cst, align 1 @@ -14,7 +14,7 @@ } ; CHECK-LABEL: trunc_i16_i32: -; CHECK: i32.atomic.store16 0($0), $1{{$}} +; CHECK: i32.atomic.store16 0{{$}} define void @trunc_i16_i32(i16 *%p, i32 %v) { %t = trunc i32 %v to i16 store atomic i16 %t, i16* %p seq_cst, align 2 @@ -22,7 +22,7 @@ } ; CHECK-LABEL: trunc_i8_i64: -; CHECK: i64.atomic.store8 0($0), $1{{$}} +; CHECK: i64.atomic.store8 0{{$}} define void @trunc_i8_i64(i8 *%p, i64 %v) { %t = trunc i64 %v to i8 store atomic i8 %t, i8* %p seq_cst, align 1 @@ -30,7 +30,7 @@ } ; CHECK-LABEL: trunc_i16_i64: -; CHECK: i64.atomic.store16 0($0), $1{{$}} +; CHECK: i64.atomic.store16 0{{$}} define void @trunc_i16_i64(i16 *%p, i64 %v) { %t = trunc i64 %v to i16 store atomic i16 %t, i16* %p seq_cst, align 2 @@ -38,7 +38,7 @@ } ; CHECK-LABEL: trunc_i32_i64: -; CHECK: i64.atomic.store32 0($0), $1{{$}} +; CHECK: i64.atomic.store32 0{{$}} define void @trunc_i32_i64(i32 *%p, i64 %v) { %t = trunc i64 %v to i32 store atomic i32 %t, i32* %p seq_cst, align 4 Index: test/CodeGen/WebAssembly/store-trunc.ll =================================================================== --- test/CodeGen/WebAssembly/store-trunc.ll +++ test/CodeGen/WebAssembly/store-trunc.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false | FileCheck %s ; Test that truncating stores are assembled properly. @@ -6,7 +6,7 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: trunc_i8_i32: -; CHECK: i32.store8 0($0), $1{{$}} +; CHECK: i32.store8 0{{$}} define void @trunc_i8_i32(i8 *%p, i32 %v) { %t = trunc i32 %v to i8 store i8 %t, i8* %p @@ -14,7 +14,7 @@ } ; CHECK-LABEL: trunc_i16_i32: -; CHECK: i32.store16 0($0), $1{{$}} +; CHECK: i32.store16 0{{$}} define void @trunc_i16_i32(i16 *%p, i32 %v) { %t = trunc i32 %v to i16 store i16 %t, i16* %p @@ -22,7 +22,7 @@ } ; CHECK-LABEL: trunc_i8_i64: -; CHECK: i64.store8 0($0), $1{{$}} +; CHECK: i64.store8 0{{$}} define void @trunc_i8_i64(i8 *%p, i64 %v) { %t = trunc i64 %v to i8 store i8 %t, i8* %p @@ -30,7 +30,7 @@ } ; CHECK-LABEL: trunc_i16_i64: -; CHECK: i64.store16 0($0), $1{{$}} +; CHECK: i64.store16 0{{$}} define void @trunc_i16_i64(i16 *%p, i64 %v) { %t = trunc i64 %v to i16 store i16 %t, i16* %p @@ -38,7 +38,7 @@ } ; CHECK-LABEL: trunc_i32_i64: -; CHECK: i64.store32 0($0), $1{{$}} +; CHECK: i64.store32 0{{$}} define void @trunc_i32_i64(i32 *%p, i64 %v) { %t = trunc i64 %v to i32 store i32 %t, i32* %p Index: test/CodeGen/WebAssembly/store.ll =================================================================== --- test/CodeGen/WebAssembly/store.ll +++ test/CodeGen/WebAssembly/store.ll @@ -8,9 +8,9 @@ ; CHECK-LABEL: sti32: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i32.store 0($pop[[L0]]), $pop[[L1]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti32(i32 *%p, i32 %v) { store i32 %v, i32* %p @@ -19,9 +19,9 @@ ; CHECK-LABEL: sti64: ; CHECK-NEXT: .param i32, i64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: i64.store 0($pop[[L0]]), $pop[[L1]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: i64.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @sti64(i64 *%p, i64 %v) { store i64 %v, i64* %p @@ -30,9 +30,9 @@ ; CHECK-LABEL: stf32: ; CHECK-NEXT: .param i32, f32{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f32.store 0($pop[[L0]]), $pop[[L1]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @stf32(float *%p, float %v) { store float %v, float* %p @@ -41,9 +41,9 @@ ; CHECK-LABEL: stf64: ; CHECK-NEXT: .param i32, f64{{$}} -; CHECK-NEXT: get_local $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: get_local $push[[L1:[0-9]+]]=, 1{{$}} -; CHECK-NEXT: f64.store 0($pop[[L0]]), $pop[[L1]]{{$}} +; CHECK-NEXT: get_local 0{{$}} +; CHECK-NEXT: get_local 1{{$}} +; CHECK-NEXT: f64.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @stf64(double *%p, double %v) { store double %v, double* %p Index: test/CodeGen/WebAssembly/switch.ll =================================================================== --- test/CodeGen/WebAssembly/switch.ll +++ test/CodeGen/WebAssembly/switch.ll @@ -14,13 +14,13 @@ declare void @foo5() ; CHECK-LABEL: bar32: -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} ; CHECK: br_table {{[^,]+}}, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5, 0{{$}} ; CHECK: .LBB0_2: ; CHECK: call foo0@FUNCTION{{$}} @@ -94,13 +94,13 @@ } ; CHECK-LABEL: bar64: -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} -; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} +; CHECK: block {{$}} ; CHECK: br_table {{[^,]+}}, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 4, 5, 0{{$}} ; CHECK: .LBB1_2: ; CHECK: call foo0@FUNCTION{{$}} Index: test/CodeGen/WebAssembly/tls.ll =================================================================== --- test/CodeGen/WebAssembly/tls.ll +++ test/CodeGen/WebAssembly/tls.ll @@ -1,11 +1,11 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -thread-model=single | FileCheck --check-prefix=SINGLE %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -thread-model=single | FileCheck --check-prefix=SINGLE %s target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" ; SINGLE-LABEL: address_of_tls: define i32 @address_of_tls() { - ; SINGLE: i32.const $push0=, tls - ; SINGLE-NEXT: return $pop0 + ; SINGLE: i32.const tls + ; SINGLE-NEXT: return ret i32 ptrtoint(i32* @tls to i32) } Index: test/CodeGen/WebAssembly/umulo-i64.ll =================================================================== --- test/CodeGen/WebAssembly/umulo-i64.ll +++ test/CodeGen/WebAssembly/umulo-i64.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false | FileCheck %s ; Test that UMULO works correctly on 64-bit operands. target datalayout = "e-m:e-p:32:32-i64:64-n32:64-S128" target triple = "wasm32-unknown-unknown" @@ -21,8 +21,8 @@ attributes #1 = { nounwind readnone speculatable } ; CHECK-LABEL: wut: -; CHECK: call __multi3@FUNCTION, $2, $0, $pop0, $1, $pop7 -; CHECK: i64.load $0=, 8($2) +; CHECK: call __multi3@FUNCTION +; CHECK: i64.load $0=, 8 define i1 @wut(i64, i64) { start: %2 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %0, i64 %1) Index: test/CodeGen/WebAssembly/unsupported-function-bitcasts.ll =================================================================== --- test/CodeGen/WebAssembly/unsupported-function-bitcasts.ll +++ test/CodeGen/WebAssembly/unsupported-function-bitcasts.ll @@ -8,9 +8,9 @@ target triple = "wasm32-unknown-unknown" ; CHECK-LABEL: test: -; CHECK-NEXT: i32.const $push[[L0:[0-9]+]]=, 0{{$}} -; CHECK-NEXT: call has_i64_arg@FUNCTION, $pop[[L0]]{{$}} -; CHECK-NEXT: i32.call $push{{[0-9]+}}=, has_i64_ret@FUNCTION{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: call has_i64_arg@FUNCTION{{$}} +; CHECK-NEXT: i32.call has_i64_ret@FUNCTION{{$}} ; CHECK-NEXT: drop ; CHECK-NEXT: end_function Index: test/CodeGen/WebAssembly/unused-argument.ll =================================================================== --- test/CodeGen/WebAssembly/unused-argument.ll +++ test/CodeGen/WebAssembly/unused-argument.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt | FileCheck %s ; Make sure that argument offsets are correct even if some arguments are unused. @@ -8,7 +8,7 @@ ; CHECK-LABEL: unused_first: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: return $1{{$}} +; CHECK-NEXT: return define i32 @unused_first(i32 %x, i32 %y) { ret i32 %y } @@ -16,13 +16,13 @@ ; CHECK-LABEL: unused_second: ; CHECK-NEXT: .param i32, i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: return $0{{$}} +; CHECK-NEXT: return define i32 @unused_second(i32 %x, i32 %y) { ret i32 %x } ; CHECK-LABEL: call_something: -; CHECK-NEXT: {{^}} i32.call $drop=, return_something@FUNCTION{{$}} +; CHECK-NEXT: {{^}} i32.call return_something@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} declare i32 @return_something() define void @call_something() { Index: test/CodeGen/WebAssembly/userstack.ll =================================================================== --- test/CodeGen/WebAssembly/userstack.ll +++ test/CodeGen/WebAssembly/userstack.ll @@ -10,39 +10,39 @@ ; Check that there is an extra local for the stack pointer. ; CHECK: .local i32{{$}} define void @alloca32() noredzone { - ; CHECK-NEXT: get_global $push[[L2:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: i32.const $push[[L3:.+]]=, 16 - ; CHECK-NEXT: i32.sub $push[[L9:.+]]=, $pop[[L2]], $pop[[L3]] - ; CHECK-NEXT: tee_local $push[[L8:.+]]=, [[SP:.+]], $pop[[L9]]{{$}} - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L8]]{{$}} + ; CHECK-NEXT: get_global __stack_pointer{{$}} + ; CHECK-NEXT: i32.const 16 + ; CHECK-NEXT: i32.sub + ; CHECK-NEXT: tee_local [[SP:.+]]{{$}} + ; CHECK-NEXT: set_global __stack_pointer{{$}} %retval = alloca i32 - ; CHECK: get_local $push[[L4:.+]]=, [[SP]]{{$}} - ; CHECK: i32.const $push[[L0:.+]]=, 0 - ; CHECK: i32.store 12($pop[[L4]]), $pop[[L0]] + ; CHECK: get_local [[SP]]{{$}} + ; CHECK: i32.const 0 + ; CHECK: i32.store 12 store i32 0, i32* %retval - ; CHECK: get_local $push[[L6:.+]]=, [[SP]]{{$}} - ; CHECK-NEXT: i32.const $push[[L5:.+]]=, 16 - ; CHECK-NEXT: i32.add $push[[L7:.+]]=, $pop[[L6]], $pop[[L5]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L7]] + ; CHECK: get_local [[SP]]{{$}} + ; CHECK-NEXT: i32.const 16 + ; CHECK-NEXT: i32.add + ; CHECK-NEXT: set_global __stack_pointer ret void } ; CHECK-LABEL: alloca3264: ; CHECK: .local i32{{$}} define void @alloca3264() { - ; CHECK: get_global $push[[L3:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: i32.const $push[[L4:.+]]=, 16 - ; CHECK-NEXT: i32.sub $push[[L6:.+]]=, $pop[[L3]], $pop[[L4]] - ; CHECK-NEXT: tee_local $push[[L5:.+]]=, [[SP:.+]], $pop[[L6]] + ; CHECK: get_global __stack_pointer{{$}} + ; CHECK-NEXT: i32.const 16 + ; CHECK-NEXT: i32.sub + ; CHECK-NEXT: tee_local [[SP:.+]] %r1 = alloca i32 %r2 = alloca double store i32 0, i32* %r1 store double 0.0, double* %r2 - ; CHECK-NEXT: i64.const $push[[L1:.+]]=, 0 - ; CHECK-NEXT: i64.store 0($pop[[L5]]), $pop[[L1]] - ; CHECK-NEXT: get_local $push[[L2:.+]]=, [[SP]]{{$}} - ; CHECK-NEXT: i32.const $push[[L0:.+]]=, 0 - ; CHECK-NEXT: i32.store 12($pop[[L2]]), $pop[[L0]] + ; CHECK-NEXT: i64.const 0 + ; CHECK-NEXT: i64.store 0 + ; CHECK-NEXT: get_local [[SP]]{{$}} + ; CHECK-NEXT: i32.const 0 + ; CHECK-NEXT: i32.store 12 ; CHECK-NEXT: return ret void } @@ -50,57 +50,57 @@ ; CHECK-LABEL: allocarray: ; CHECK: .local i32{{$}} define void @allocarray() { - ; CHECK-NEXT: get_global $push[[L4:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: i32.const $push[[L5:.+]]=, 144{{$}} - ; CHECK-NEXT: i32.sub $push[[L12:.+]]=, $pop[[L4]], $pop[[L5]] - ; CHECK-NEXT: tee_local $push[[L11:.+]]=, 0, $pop[[L12]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L11]] + ; CHECK-NEXT: get_global __stack_pointer{{$}} + ; CHECK-NEXT: i32.const 144{{$}} + ; CHECK-NEXT: i32.sub + ; CHECK-NEXT: tee_local 0 + ; CHECK-NEXT: set_global __stack_pointer %r = alloca [33 x i32] - ; CHECK: i32.const $push{{.+}}=, 24 - ; CHECK-NEXT: i32.add $push[[L3:.+]]=, $pop{{.+}}, $pop{{.+}} - ; CHECK-NEXT: i32.const $push[[L1:.+]]=, 1{{$}} - ; CHECK-NEXT: i32.store 0($pop[[L3]]), $pop[[L1]]{{$}} - ; CHECK-NEXT: get_local $push[[L4:.+]]=, 0{{$}} - ; CHECK-NEXT: i32.const $push[[L10:.+]]=, 1{{$}} - ; CHECK-NEXT: i32.store 12($pop[[L4]]), $pop[[L10]]{{$}} + ; CHECK: i32.const 24 + ; CHECK-NEXT: i32.add + ; CHECK-NEXT: i32.const 1{{$}} + ; CHECK-NEXT: i32.store 0{{$}} + ; CHECK-NEXT: get_local 0{{$}} + ; CHECK-NEXT: i32.const 1{{$}} + ; CHECK-NEXT: i32.store 12{{$}} %p = getelementptr [33 x i32], [33 x i32]* %r, i32 0, i32 0 store i32 1, i32* %p %p2 = getelementptr [33 x i32], [33 x i32]* %r, i32 0, i32 3 store i32 1, i32* %p2 - ; CHECK-NEXT: get_local $push[[L2:.+]]=, [[SP]]{{$}} - ; CHECK-NEXT: i32.const $push[[L7:.+]]=, 144 - ; CHECK-NEXT: i32.add $push[[L8:.+]]=, $pop[[L2]], $pop[[L7]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L8]] + ; CHECK-NEXT: get_local [[SP]]{{$}} + ; CHECK-NEXT: i32.const 144 + ; CHECK-NEXT: i32.add + ; CHECK-NEXT: set_global __stack_pointer ret void } ; CHECK-LABEL: non_mem_use define void @non_mem_use(i8** %addr) { - ; CHECK: i32.const $push[[L2:.+]]=, 48 - ; CHECK-NEXT: i32.sub $push[[L12:.+]]=, {{.+}}, $pop[[L2]] - ; CHECK-NEXT: tee_local $push[[L11:.+]]=, [[SP:.+]], $pop[[L12]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L11]] + ; CHECK: i32.const 48 + ; CHECK-NEXT: i32.sub {{.+}} + ; CHECK-NEXT: tee_local [[SP:.+]] + ; CHECK-NEXT: set_global __stack_pointer %buf = alloca [27 x i8], align 16 %r = alloca i64 %r2 = alloca i64 ; %r is at SP+8 - ; CHECK: get_local $push[[L3:.+]]=, [[SP]] - ; CHECK: i32.const $push[[OFF:.+]]=, 8 - ; CHECK-NEXT: i32.add $push[[ARG1:.+]]=, $pop[[L3]], $pop[[OFF]] - ; CHECK-NEXT: call ext_func@FUNCTION, $pop[[ARG1]] + ; CHECK: get_local [[SP]] + ; CHECK: i32.const 8 + ; CHECK-NEXT: i32.add + ; CHECK-NEXT: call ext_func@FUNCTION call void @ext_func(i64* %r) ; %r2 is at SP+0, no add needed - ; CHECK: get_local $push[[L4:.+]]=, [[SP]] - ; CHECK-NEXT: call ext_func@FUNCTION, $pop[[L4]] + ; CHECK: get_local [[SP]] + ; CHECK-NEXT: call ext_func@FUNCTION call void @ext_func(i64* %r2) ; Use as a value, but in a store ; %buf is at SP+16 - ; CHECK: get_local $push[[L5:.+]]=, [[SP]] - ; CHECK: i32.const $push[[OFF:.+]]=, 16 - ; CHECK-NEXT: i32.add $push[[VAL:.+]]=, $pop[[L5]], $pop[[OFF]] - ; CHECK-NEXT: i32.store 0($pop{{.+}}), $pop[[VAL]] + ; CHECK: get_local [[SP]] + ; CHECK: i32.const 16 + ; CHECK-NEXT: i32.add + ; CHECK-NEXT: i32.store 0 %gep = getelementptr inbounds [27 x i8], [27 x i8]* %buf, i32 0, i32 0 store i8* %gep, i8** %addr ret void @@ -109,55 +109,55 @@ ; CHECK-LABEL: allocarray_inbounds: ; CHECK: .local i32{{$}} define void @allocarray_inbounds() { - ; CHECK: get_global $push[[L3:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: i32.const $push[[L4:.+]]=, 32{{$}} - ; CHECK-NEXT: i32.sub $push[[L11:.+]]=, $pop[[L3]], $pop[[L4]] - ; CHECK-NEXT: tee_local $push[[L10:.+]]=, [[SP:.+]], $pop[[L11]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L10]]{{$}} + ; CHECK: get_global __stack_pointer{{$}} + ; CHECK-NEXT: i32.const 32{{$}} + ; CHECK-NEXT: i32.sub + ; CHECK-NEXT: tee_local [[SP:.+]] + ; CHECK-NEXT: set_global __stack_pointer{{$}} %r = alloca [5 x i32] - ; CHECK: i32.const $push[[L3:.+]]=, 1 - ; CHECK-DAG: i32.store 24(${{.+}}), $pop[[L3]] + ; CHECK: i32.const 1 + ; CHECK-DAG: i32.store 24(${{.+}}) %p = getelementptr inbounds [5 x i32], [5 x i32]* %r, i32 0, i32 0 store i32 1, i32* %p ; This store should have both the GEP and the FI folded into it. - ; CHECK-DAG: i32.store 12(${{.+}}), $pop + ; CHECK-DAG: i32.store 12(${{.+}}) %p2 = getelementptr inbounds [5 x i32], [5 x i32]* %r, i32 0, i32 3 store i32 1, i32* %p2 call void @ext_func(i64* null); ; CHECK: call ext_func - ; CHECK: i32.const $push[[L5:.+]]=, 32{{$}} - ; CHECK-NEXT: i32.add $push[[L7:.+]]=, ${{.+}}, $pop[[L5]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L7]] + ; CHECK: i32.const 32{{$}} + ; CHECK-NEXT: i32.add ${{.+}} + ; CHECK-NEXT: set_global __stack_pointer ret void } ; CHECK-LABEL: dynamic_alloca: define void @dynamic_alloca(i32 %alloc) { - ; CHECK: get_global $push[[L13:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: tee_local $push[[L12:.+]]=, [[SP:.+]], $pop[[L13]]{{$}} + ; CHECK: get_global __stack_pointer{{$}} + ; CHECK-NEXT: tee_local [[SP:.+]]{{$}} ; Target independent codegen bumps the stack pointer. ; CHECK: i32.sub ; Check that SP is written back to memory after decrement - ; CHECK: set_global __stack_pointer, + ; CHECK: set_global __stack_pointer, %r = alloca i32, i32 %alloc ; Target-independent codegen also calculates the store addr ; CHECK: call ext_func_i32@FUNCTION call void @ext_func_i32(i32* %r) - ; CHECK: set_global __stack_pointer, $pop{{.+}} + ; CHECK: set_global __stack_pointer ret void } ; CHECK-LABEL: dynamic_alloca_redzone: define void @dynamic_alloca_redzone(i32 %alloc) { - ; CHECK: get_global $push[[L13:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: tee_local $push[[L12:.+]]=, [[SP:.+]], $pop[[L13]]{{$}} + ; CHECK: get_global __stack_pointer{{$}} + ; CHECK-NEXT: tee_local [[SP:.+]]{{$}} ; Target independent codegen bumps the stack pointer ; CHECK: i32.sub %r = alloca i32, i32 %alloc - ; CHECK-NEXT: tee_local $push[[L8:.+]]=, {{.+}}, $pop - ; CHECK: get_local $push[[L7:.+]]=, 0{{$}} - ; CHECK-NEXT: i32.const $push[[L6:.+]]=, 0{{$}} - ; CHECK-NEXT: i32.store 0($pop[[L7]]), $pop[[L6]]{{$}} + ; CHECK-NEXT: tee_local {{.+}} + ; CHECK: get_local 0{{$}} + ; CHECK-NEXT: i32.const 0{{$}} + ; CHECK-NEXT: i32.store 0{{$}} store i32 0, i32* %r ; CHECK-NEXT: return ret void @@ -166,67 +166,67 @@ ; CHECK-LABEL: dynamic_static_alloca: define void @dynamic_static_alloca(i32 %alloc) noredzone { ; Decrement SP in the prolog by the static amount and writeback to memory. - ; CHECK: get_global $push[[L11:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: i32.const $push[[L12:.+]]=, 16 - ; CHECK-NEXT: i32.sub $push[[L23:.+]]=, $pop[[L11]], $pop[[L12]] - ; CHECK-NEXT: tee_local $push[[L22:.+]]=, [[SP:.+]], $pop[[L23]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L22]] + ; CHECK: get_global __stack_pointer{{$}} + ; CHECK-NEXT: i32.const 16 + ; CHECK-NEXT: i32.sub + ; CHECK-NEXT: tee_local [[SP:.+]] + ; CHECK-NEXT: set_global __stack_pointer ; Alloc and write to a static alloca - ; CHECK: get_local $push[[L21:.+]]=, [[SP:.+]] - ; CHECK-NEXT: tee_local $push[[pushedFP:.+]]=, [[FP:.+]], $pop[[L21]] - ; CHECK-NEXT: i32.const $push[[L0:.+]]=, 101 - ; CHECK-NEXT: i32.store [[static_offset:.+]]($pop[[pushedFP]]), $pop[[L0]] + ; CHECK: get_local [[SP:.+]] + ; CHECK-NEXT: tee_local [[FP:.+]] + ; CHECK-NEXT: i32.const 101 + ; CHECK-NEXT: i32.store [[static_offset:.+]] %static = alloca i32 store volatile i32 101, i32* %static ; Decrement SP in the body by the dynamic amount. ; CHECK: i32.sub - ; CHECK: tee_local $push[[L16:.+]]=, [[dynamic_local:.+]], $pop{{.+}} - ; CHECK: tee_local $push[[L15:.+]]=, [[other:.+]], $pop[[L16]]{{$}} - ; CHECK: set_global __stack_pointer, $pop[[L15]]{{$}} + ; CHECK: tee_local [[dynamic_local:.+]] + ; CHECK: tee_local [[other:.+]]{{$}} + ; CHECK: set_global __stack_pointer{{$}} %dynamic = alloca i32, i32 %alloc ; Ensure we don't modify the frame pointer after assigning it. ; CHECK-NOT: $[[FP]]= ; Ensure the static address doesn't change after modifying the stack pointer. - ; CHECK: get_local $push[[L17:.+]]=, [[FP]] - ; CHECK: i32.const $push[[L7:.+]]=, 102 - ; CHECK-NEXT: i32.store [[static_offset]]($pop[[L17]]), $pop[[L7]] - ; CHECK-NEXT: get_local $push[[L9:.+]]=, [[dynamic_local]]{{$}} - ; CHECK-NEXT: i32.const $push[[L8:.+]]=, 103 - ; CHECK-NEXT: i32.store 0($pop[[L9]]), $pop[[L8]] + ; CHECK: get_local [[FP]] + ; CHECK: i32.const 102 + ; CHECK-NEXT: i32.store [[static_offset]] + ; CHECK-NEXT: get_local [[dynamic_local]]{{$}} + ; CHECK-NEXT: i32.const 103 + ; CHECK-NEXT: i32.store 0 store volatile i32 102, i32* %static store volatile i32 103, i32* %dynamic ; Decrement SP in the body by the dynamic amount. ; CHECK: i32.sub - ; CHECK: tee_local $push{{.+}}=, [[dynamic2_local:.+]], $pop{{.+}} + ; CHECK: tee_local [[dynamic2_local:.+]] %dynamic.2 = alloca i32, i32 %alloc ; CHECK-NOT: $[[FP]]= ; Ensure neither the static nor dynamic address changes after the second ; modification of the stack pointer. - ; CHECK: get_local $push[[L22:.+]]=, [[FP]] - ; CHECK: i32.const $push[[L9:.+]]=, 104 - ; CHECK-NEXT: i32.store [[static_offset]]($pop[[L22]]), $pop[[L9]] - ; CHECK-NEXT: get_local $push[[L23:.+]]=, [[dynamic_local]] - ; CHECK-NEXT: i32.const $push[[L10:.+]]=, 105 - ; CHECK-NEXT: i32.store 0($pop[[L23]]), $pop[[L10]] - ; CHECK-NEXT: get_local $push[[L23:.+]]=, [[dynamic2_local]] - ; CHECK-NEXT: i32.const $push[[L11:.+]]=, 106 - ; CHECK-NEXT: i32.store 0($pop[[L23]]), $pop[[L11]] + ; CHECK: get_local [[FP]] + ; CHECK: i32.const 104 + ; CHECK-NEXT: i32.store [[static_offset]] + ; CHECK-NEXT: get_local [[dynamic_local]] + ; CHECK-NEXT: i32.const 105 + ; CHECK-NEXT: i32.store 0 + ; CHECK-NEXT: get_local [[dynamic2_local]] + ; CHECK-NEXT: i32.const 106 + ; CHECK-NEXT: i32.store 0 store volatile i32 104, i32* %static store volatile i32 105, i32* %dynamic store volatile i32 106, i32* %dynamic.2 ; Writeback to memory. - ; CHECK: get_local $push[[L24:.+]]=, [[FP]]{{$}} - ; CHECK: i32.const $push[[L18:.+]]=, 16 - ; CHECK-NEXT: i32.add $push[[L19:.+]]=, $pop[[L24]], $pop[[L18]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L19]] + ; CHECK: get_local [[FP]]{{$}} + ; CHECK: i32.const 16 + ; CHECK-NEXT: i32.add + ; CHECK-NEXT: set_global __stack_pointer ret void } @@ -235,17 +235,17 @@ ; CHECK-LABEL: llvm_stack_builtins: define void @llvm_stack_builtins(i32 %alloc) noredzone { - ; CHECK: get_global $push[[L11:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: tee_local $push[[L10:.+]]=, {{.+}}, $pop[[L11]] - ; CHECK-NEXT: set_local [[STACK:.+]], $pop[[L10]] + ; CHECK: get_global __stack_pointer{{$}} + ; CHECK-NEXT: tee_local {{.+}} + ; CHECK-NEXT: set_local [[STACK:.+]] %stack = call i8* @llvm.stacksave() ; Ensure we don't reassign the stacksave local ; CHECK-NOT: set_local [[STACK]], %dynamic = alloca i32, i32 %alloc - ; CHECK: get_local $push[[L12:.+]]=, [[STACK]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L12]] + ; CHECK: get_local [[STACK]] + ; CHECK-NEXT: set_global __stack_pointer call void @llvm.stackrestore(i8* %stack) ret void @@ -256,15 +256,15 @@ ; moved after the stack pointer was updated for the dynamic alloca. ; CHECK-LABEL: dynamic_alloca_nouse: define void @dynamic_alloca_nouse(i32 %alloc) noredzone { - ; CHECK: get_global $push[[L11:.+]]=, __stack_pointer{{$}} - ; CHECK-NEXT: tee_local $push[[L10:.+]]=, {{.+}}, $pop[[L11]] - ; CHECK-NEXT: set_local [[FP:.+]], $pop[[L10]] + ; CHECK: get_global __stack_pointer{{$}} + ; CHECK-NEXT: tee_local {{.+}} + ; CHECK-NEXT: set_local [[FP:.+]] %dynamic = alloca i32, i32 %alloc ; CHECK-NOT: set_local [[FP]], - ; CHECK: get_local $push[[L12:.+]]=, [[FP]] - ; CHECK-NEXT: set_global __stack_pointer, $pop[[L12]] + ; CHECK: get_local [[FP]] + ; CHECK-NEXT: set_global __stack_pointer ret void } @@ -273,18 +273,18 @@ ; CHECK-LABEL: copytoreg_fi: define void @copytoreg_fi(i1 %cond, i32* %b) { entry: - ; CHECK: i32.const $push[[L1:.+]]=, 16 - ; CHECK-NEXT: i32.sub $push[[L3:.+]]=, {{.+}}, $pop[[L1]] + ; CHECK: i32.const 16 + ; CHECK-NEXT: i32.sub {{.+}} %addr = alloca i32 - ; CHECK: i32.const $push[[OFF:.+]]=, 12 - ; CHECK-NEXT: i32.add $push[[ADDR:.+]]=, $pop[[L3]], $pop[[OFF]] - ; CHECK-NEXT: set_local [[COPY:.+]], $pop[[ADDR]] + ; CHECK: i32.const 12 + ; CHECK-NEXT: i32.add + ; CHECK-NEXT: set_local [[COPY:.+]] br label %body body: %a = phi i32* [%addr, %entry], [%b, %body] store i32 1, i32* %a - ; CHECK: get_local $push[[L12:.+]]=, [[COPY]] - ; CHECK: i32.store 0($pop[[L12]]), + ; CHECK: get_local [[COPY]] + ; CHECK: i32.store 0, br i1 %cond, label %body, label %exit exit: ret void @@ -295,11 +295,11 @@ ; Test __builtin_frame_address(0). ; CHECK-LABEL: frameaddress_0: -; CHECK: get_global $push[[L3:.+]]=, __stack_pointer{{$}} -; CHECK-NEXT: tee_local $push[[L2:.+]]=, [[FP:.+]], $pop[[L3]]{{$}} -; CHECK-NEXT: call use_i8_star@FUNCTION, $pop[[L2]] -; CHECK-NEXT: get_local $push[[L5:.+]]=, [[FP]] -; CHECK-NEXT: set_global __stack_pointer, $pop[[L5]] +; CHECK: get_global __stack_pointer{{$}} +; CHECK-NEXT: tee_local [[FP:.+]]{{$}} +; CHECK-NEXT: call use_i8_star@FUNCTION +; CHECK-NEXT: get_local [[FP]] +; CHECK-NEXT: set_global __stack_pointer define void @frameaddress_0() { %t = call i8* @llvm.frameaddress(i32 0) call void @use_i8_star(i8* %t) @@ -309,8 +309,8 @@ ; Test __builtin_frame_address(1). ; CHECK-LABEL: frameaddress_1: -; CHECK-NEXT: i32.const $push0=, 0{{$}} -; CHECK-NEXT: call use_i8_star@FUNCTION, $pop0{{$}} +; CHECK-NEXT: i32.const 0{{$}} +; CHECK-NEXT: call use_i8_star@FUNCTION{{$}} ; CHECK-NEXT: return{{$}} define void @frameaddress_1() { %t = call i8* @llvm.frameaddress(i32 1) Index: test/CodeGen/WebAssembly/varargs.ll =================================================================== --- test/CodeGen/WebAssembly/varargs.ll +++ test/CodeGen/WebAssembly/varargs.ll @@ -1,4 +1,4 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -disable-wasm-explicit-locals -verify-machineinstrs | FileCheck %s +; RUN: llc < %s -asm-verbose=false -disable-wasm-fallthrough-return-opt -verify-machineinstrs | FileCheck %s ; Test varargs constructs. @@ -15,7 +15,7 @@ entry: %0 = bitcast i8** %ap to i8* ; Store the second argument (the hidden vararg buffer pointer) into ap -; CHECK: i32.store 0($0), $1 +; CHECK: i32.store 0 call void @llvm.va_start(i8* %0) ret void } @@ -36,8 +36,8 @@ ; CHECK-LABEL: copy: ; CHECK-NEXT: .param i32, i32{{$}} -; CHECK-NEXT: i32.load $push0=, 0($1){{$}} -; CHECK-NEXT: i32.store 0($0), $pop0{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: i32.store 0{{$}} ; CHECK-NEXT: return{{$}} define void @copy(i8** %ap, i8** %bp) { entry: @@ -52,13 +52,13 @@ ; CHECK-LABEL: arg_i8: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load $push[[NUM0:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: tee_local $push[[NUM1:[0-9]+]]=, $1=, $pop[[NUM0]]{{$}} -; CHECK-NEXT: i32.const $push[[NUM2:[0-9]+]]=, 4{{$}} -; CHECK-NEXT: i32.add $push[[NUM3:[0-9]+]]=, $pop[[NUM1]], $pop[[NUM2]]{{$}} -; CHECK-NEXT: i32.store 0($0), $pop[[NUM3]]{{$}} -; CHECK-NEXT: i32.load $push[[NUM4:[0-9]+]]=, 0($1){{$}} -; CHECK-NEXT: return $pop[[NUM4]]{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: tee_local $1={{$}} +; CHECK-NEXT: i32.const 4{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return{{$}} define i8 @arg_i8(i8** %ap) { entry: %t = va_arg i8** %ap, i8 @@ -70,17 +70,17 @@ ; CHECK-LABEL: arg_i32: ; CHECK-NEXT: .param i32{{$}} ; CHECK-NEXT: .result i32{{$}} -; CHECK-NEXT: i32.load $push[[NUM0:[0-9]+]]=, 0($0){{$}} -; CHECK-NEXT: i32.const $push[[NUM1:[0-9]+]]=, 3{{$}} -; CHECK-NEXT: i32.add $push[[NUM2:[0-9]+]]=, $pop[[NUM0]], $pop[[NUM1]]{{$}} -; CHECK-NEXT: i32.const $push[[NUM3:[0-9]+]]=, -4{{$}} -; CHECK-NEXT: i32.and $push[[NUM4:[0-9]+]]=, $pop[[NUM2]], $pop[[NUM3]]{{$}} -; CHECK-NEXT: tee_local $push[[NUM5:[0-9]+]]=, $1=, $pop[[NUM4]]{{$}} -; CHECK-NEXT: i32.const $push[[NUM6:[0-9]+]]=, 4{{$}} -; CHECK-NEXT: i32.add $push[[NUM7:[0-9]+]]=, $pop[[NUM5]], $pop[[NUM6]]{{$}} -; CHECK-NEXT: i32.store 0($0), $pop[[NUM7]]{{$}} -; CHECK-NEXT: i32.load $push[[NUM8:[0-9]+]]=, 0($1){{$}} -; CHECK-NEXT: return $pop[[NUM8]]{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: i32.const 3{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.const -4{{$}} +; CHECK-NEXT: i32.and{{$}} +; CHECK-NEXT: tee_local $1={{$}} +; CHECK-NEXT: i32.const 4{{$}} +; CHECK-NEXT: i32.add {{$}} +; CHECK-NEXT: i32.store 0{{$}} +; CHECK-NEXT: i32.load 0{{$}} +; CHECK-NEXT: return{{$}} define i32 @arg_i32(i8** %ap) { entry: %t = va_arg i8** %ap, i32 @@ -106,8 +106,8 @@ declare void @callee(...) ; CHECK-LABEL: caller_none: -; CHECK-NEXT: i32.const $push0=, 0 -; CHECK-NEXT: call callee@FUNCTION, $pop0 +; CHECK-NEXT: i32.const 0 +; CHECK-NEXT: call callee@FUNCTION ; CHECK-NEXT: return{{$}} define void @caller_none() { call void (...) @callee() @@ -138,7 +138,7 @@ bb1: %0 = bitcast i8** %ap to i8* ; Store the second argument (the hidden vararg buffer pointer) into ap -; CHECK: i32.store 0($1), $2 +; CHECK: i32.store 0 call void @llvm.va_start(i8* %0) ret void } @@ -148,10 +148,10 @@ declare void @callee_with_nonlegal_fixed(fp128, ...) nounwind ; CHECK-LABEL: call_nonlegal_fixed: -; CHECK: i64.const $push[[L0:[0-9]+]]=, 0 -; CHECK: i64.const $push[[L1:[0-9]+]]=, 0 -; CHECK: i32.const $push[[L2:[0-9]+]]=, 0 -; CHECK: call callee_with_nonlegal_fixed@FUNCTION, $pop[[L0]], $pop[[L1]], $pop[[L2]]{{$}} +; CHECK: i64.const 0 +; CHECK: i64.const 0 +; CHECK: i32.const 0 +; CHECK: call callee_with_nonlegal_fixed@FUNCTION{{$}} define void @call_nonlegal_fixed() nounwind { call void (fp128, ...) @callee_with_nonlegal_fixed(fp128 0xL00000000000000000000000000000000) ret void Index: test/CodeGen/WebAssembly/vtable.ll =================================================================== --- test/CodeGen/WebAssembly/vtable.ll +++ test/CodeGen/WebAssembly/vtable.ll @@ -1,6 +1,6 @@ -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s --check-prefix=TYPEINFONAME -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s --check-prefix=VTABLE -; RUN: llc < %s -asm-verbose=false -disable-wasm-explicit-locals | FileCheck %s --check-prefix=TYPEINFO +; RUN: llc < %s -asm-verbose=false | FileCheck %s --check-prefix=TYPEINFONAME +; RUN: llc < %s -asm-verbose=false | FileCheck %s --check-prefix=VTABLE +; RUN: llc < %s -asm-verbose=false | FileCheck %s --check-prefix=TYPEINFO ; Test that simple vtables assemble as expected. ; Index: test/MC/WebAssembly/basic-assembly.s =================================================================== --- test/MC/WebAssembly/basic-assembly.s +++ test/MC/WebAssembly/basic-assembly.s @@ -1,4 +1,3 @@ -# RUN: llvm-mc -triple=wasm32-unknown-unknown-elf < %s | FileCheck %s # RUN: llvm-mc -triple=wasm32-unknown-unknown < %s | FileCheck %s .text @@ -8,33 +7,33 @@ .param i32, i64 .local f32, f64 #, i8x16, i16x8, i32x4, f32x4 # Explicit getlocal/setlocal: - get_local $push0=, 2 - set_local 2, $pop0= - # Implicit locals & immediates: - i32.const $0=, -1 - f64.const $3=, 0x1.999999999999ap1 + get_local 2 + set_local 2 + # Immediates: + i32.const -1 + f64.const 0x1.999999999999ap1 # Indirect addressing: - get_local $push1=, 0 - f64.store 0($pop1), $3 + get_local 0 + f64.store 0 # Loops, conditionals, binary ops, calls etc: block - i32.const $push2=, 1 - get_local $push7=, 0 - i32.ge_s $push0=, $pop2, $pop7 - br_if 0, $pop0 # 0: down to label0 + i32.const 1 + get_local 0 + i32.ge_s + br_if 0 # 0: down to label0 .LBB0_1: loop # label1: - call $drop=, something1@FUNCTION - i64.const $push10=, 1234 - i32.call $push8=, something2@FUNCTION, $pop10 - i32.const $push11=, 0 - call_indirect $pop11 - i32.const $push5=, 1 - i32.add $push4=, $pop8, $pop5 - tee_local $push3=, 0, $pop4 - get_local $push9=, 0 - i32.lt_s $push1=, $pop3, $pop9 - br_if 0, $pop1 # 0: up to label1 + call something1@FUNCTION + i64.const 1234 + i32.call something2@FUNCTION + i32.const 0 + call_indirect + i32.const 1 + i32.add + tee_local 0 + get_local 0 + i32.lt_s + br_if 0 # 0: up to label1 .LBB0_2: end_loop end_block # label0: @@ -45,30 +44,30 @@ # CHECK-LABEL: test0: # CHECK-NEXT: .param i32, i64 # CHECK-NEXT: .local f32, f64 -# CHECK-NEXT: get_local $push0=, 2 -# CHECK-NEXT: set_local 2, $pop0 -# CHECK-NEXT: i32.const $0=, -1 -# CHECK-NEXT: f64.const $3=, 0x1.999999999999ap1 -# CHECK-NEXT: get_local $push1=, 0 -# CHECK-NEXT: f64.store 0($pop1):p2align=0, $3 +# CHECK-NEXT: get_local 2 +# CHECK-NEXT: set_local 2 +# CHECK-NEXT: i32.const -1 +# CHECK-NEXT: f64.const 0x1.999999999999ap1 +# CHECK-NEXT: get_local 0 +# CHECK-NEXT: f64.store 0, :p2align=0 # CHECK-NEXT: block -# CHECK-NEXT: i32.const $push2=, 1 -# CHECK-NEXT: get_local $push7=, 0 -# CHECK-NEXT: i32.ge_s $push0=, $pop2, $pop7 -# CHECK-NEXT: br_if 0, $pop0 # 0: down to label0 +# CHECK-NEXT: i32.const 1 +# CHECK-NEXT: get_local 0 +# CHECK-NEXT: i32.ge_s +# CHECK-NEXT: br_if 0 # 0: down to label0 # CHECK-NEXT: .LBB0_1: # CHECK-NEXT: loop # label1: # CHECK-NEXT: call something1@FUNCTION -# CHECK-NEXT: i64.const $push10=, 1234 -# CHECK-NEXT: i32.call $push8=, something2@FUNCTION -# CHECK-NEXT: i32.const $push11=, 0 +# CHECK-NEXT: i64.const 1234 +# CHECK-NEXT: i32.call something2@FUNCTION +# CHECK-NEXT: i32.const 0 # CHECK-NEXT: call_indirect -# CHECK-NEXT: i32.const $push5=, 1 -# CHECK-NEXT: i32.add $push4=, $pop8, $pop5 -# CHECK-NEXT: tee_local $push3=, 0, $pop4 -# CHECK-NEXT: get_local $push9=, 0 -# CHECK-NEXT: i32.lt_s $push1=, $pop3, $pop9 -# CHECK-NEXT: br_if 0, $pop1 # 0: up to label1 +# CHECK-NEXT: i32.const 1 +# CHECK-NEXT: i32.add +# CHECK-NEXT: tee_local 0 +# CHECK-NEXT: get_local 0 +# CHECK-NEXT: i32.lt_s +# CHECK-NEXT: br_if 0 # 0: up to label1 # CHECK-NEXT: .LBB0_2: # CHECK-NEXT: end_loop # CHECK-NEXT: end_block # label0: