Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrControl.td @@ -47,6 +47,7 @@ // FIXME: this can't inherit from I<> since there is no way to inherit from a // multiclass and still have the let statements. let isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 in { +let isCodeGenOnly = 1 in def BR_TABLE_I32 : NI<(outs), (ins I32:$index, variable_ops), [(WebAssemblybr_table I32:$index)], 0, "br_table \t$index", 0x0e> { @@ -59,6 +60,7 @@ let TSFlags{0} = 1; let TSFlags{1} = 1; } +let isCodeGenOnly = 1 in def BR_TABLE_I64 : NI<(outs), (ins I64:$index, variable_ops), [(WebAssemblybr_table I64:$index)], 0, "br_table \t$index"> { Index: llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrFormats.td =================================================================== --- llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrFormats.td +++ llvm/trunk/lib/Target/WebAssembly/WebAssemblyInstrFormats.td @@ -48,6 +48,7 @@ multiclass I pattern_r, string asmstr_r = "", string asmstr_s = "", bits<32> inst = -1> { + let isCodeGenOnly = 1 in def "" : NI; def _S : NI; } Index: llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp =================================================================== --- llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp +++ llvm/trunk/utils/TableGen/AsmMatcherEmitter.cpp @@ -1479,8 +1479,6 @@ bool ReportMultipleNearMisses = AsmParser->getValueAsBit("ReportMultipleNearMisses"); - bool IsWebAssemblyTarget = Target.getName() == "WebAssembly"; - // Parse the instructions; we need to do this first so that we can gather the // singleton register classes. SmallPtrSet SingletonRegisters; @@ -1516,14 +1514,6 @@ if (!V.empty() && V != Variant.Name) continue; - // [WebAssembly] Ignore non-stack instructions. - if (IsWebAssemblyTarget) { - auto Bit = CGI->TheDef->getValue("StackBased")->getValue()-> - getCastTo(BitRecTy::get()); - if (!Bit || !reinterpret_cast(Bit)->getValue()) - continue; - } - auto II = llvm::make_unique(*CGI); II->initialize(*this, SingletonRegisters, Variant, HasMnemonicFirst);