Index: lib/Target/WebAssembly/WebAssemblyInstrAtomics.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrAtomics.td +++ lib/Target/WebAssembly/WebAssemblyInstrAtomics.td @@ -24,10 +24,8 @@ Requires<[HasAtomics]>; } -let Defs = [ARGUMENTS] in { defm ATOMIC_LOAD_I32 : WebAssemblyLoad; defm ATOMIC_LOAD_I64 : WebAssemblyLoad; -} // Defs = [ARGUMENTS] // Select loads with no constant offset. let Predicates = [HasAtomics] in { @@ -62,13 +60,11 @@ // Extending loads. Note that there are only zero-extending atomic loads, no // sign-extending loads. -let Defs = [ARGUMENTS] in { defm ATOMIC_LOAD8_U_I32 : WebAssemblyLoad; defm ATOMIC_LOAD16_U_I32 : WebAssemblyLoad; defm ATOMIC_LOAD8_U_I64 : WebAssemblyLoad; defm ATOMIC_LOAD16_U_I64 : WebAssemblyLoad; defm ATOMIC_LOAD32_U_I64 : WebAssemblyLoad; -} // Defs = [ARGUMENTS] // Fragments for extending loads. These are different from regular loads because // the SDNodes are derived from AtomicSDNode rather than LoadSDNode and @@ -200,10 +196,8 @@ // Atomic stores //===----------------------------------------------------------------------===// -let Defs = [ARGUMENTS] in { defm ATOMIC_STORE_I32 : WebAssemblyStore; defm ATOMIC_STORE_I64 : WebAssemblyStore; -} // Defs = [ARGUMENTS] // We need an 'atomic' version of store patterns because store and atomic_store // nodes have different operand orders: @@ -263,13 +257,11 @@ } // Predicates = [HasAtomics] // Truncating stores. -let Defs = [ARGUMENTS] in { defm ATOMIC_STORE8_I32 : WebAssemblyStore; defm ATOMIC_STORE16_I32 : WebAssemblyStore; defm ATOMIC_STORE8_I64 : WebAssemblyStore; defm ATOMIC_STORE16_I64 : WebAssemblyStore; defm ATOMIC_STORE32_I64 : WebAssemblyStore; -} // Defs = [ARGUMENTS] // Fragments for truncating stores. @@ -341,8 +333,6 @@ // Atomic binary read-modify-writes //===----------------------------------------------------------------------===// -let Defs = [ARGUMENTS] in { - multiclass WebAssemblyBinRMW { defm "" : I<(outs rc:$dst), (ins P2Align:$p2align, offset32_op:$off, I32:$addr, rc:$val), @@ -430,7 +420,6 @@ WebAssemblyBinRMW; defm ATOMIC_RMW32_U_XCHG_I64 : WebAssemblyBinRMW; -} // Select binary RMWs with no constant offset. class BinRMWPatNoOffset : @@ -674,8 +663,6 @@ // Consider adding a pass after instruction selection that optimizes this case // if it is frequent. -let Defs = [ARGUMENTS] in { - multiclass WebAssemblyTerRMW { defm "" : I<(outs rc:$dst), (ins P2Align:$p2align, offset32_op:$off, I32:$addr, rc:$exp, @@ -699,7 +686,6 @@ WebAssemblyTerRMW; defm ATOMIC_RMW32_U_CMPXCHG_I64 : WebAssemblyTerRMW; -} // Select ternary RMWs with no constant offset. class TerRMWPatNoOffset : @@ -912,7 +898,6 @@ // Atomic wait / notify //===----------------------------------------------------------------------===// -let Defs = [ARGUMENTS] in { let hasSideEffects = 1 in { defm ATOMIC_NOTIFY : I<(outs I32:$dst), @@ -935,7 +920,6 @@ "i64.atomic.wait \t${off}, ${p2align}", 0xfe02>; } // mayLoad = 1 } // hasSideEffects = 1 -} // Defs = [ARGUMENTS] let Predicates = [HasAtomics] in { // Select notifys with no constant offset. Index: lib/Target/WebAssembly/WebAssemblyInstrCall.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrCall.td +++ lib/Target/WebAssembly/WebAssemblyInstrCall.td @@ -15,8 +15,6 @@ // TODO: addr64: These currently assume the callee address is 32-bit. // FIXME: add $type to first call_indirect asmstr (and maybe $flags) -let Defs = [ARGUMENTS] in { - // Call sequence markers. These have an immediate which represents the amount of // stack space to allocate or free, which is used for varargs lowering. let Uses = [SP32, SP64], Defs = [SP32, SP64], isCodeGenOnly = 1 in { @@ -118,8 +116,6 @@ 0x11>; } // Uses = [SP32,SP64], isCall = 1 -} // Defs = [ARGUMENTS] - // Patterns for matching a direct call to a global address. def : Pat<(i32 (WebAssemblycall1 (WebAssemblywrapper tglobaladdr:$callee))), (CALL_I32 tglobaladdr:$callee)>; Index: lib/Target/WebAssembly/WebAssemblyInstrControl.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrControl.td +++ lib/Target/WebAssembly/WebAssemblyInstrControl.td @@ -12,8 +12,6 @@ /// //===----------------------------------------------------------------------===// -let Defs = [ARGUMENTS] in { - let isBranch = 1, isTerminator = 1, hasCtrlDep = 1 in { // The condition operand is a boolean value which WebAssembly represents as i32. defm BR_IF : I<(outs), (ins bb_op:$dst, I32:$cond), @@ -30,15 +28,11 @@ } // isBarrier = 1 } // isBranch = 1, isTerminator = 1, hasCtrlDep = 1 -} // Defs = [ARGUMENTS] - def : Pat<(brcond (i32 (setne I32:$cond, 0)), bb:$dst), (BR_IF bb_op:$dst, I32:$cond)>; def : Pat<(brcond (i32 (seteq I32:$cond, 0)), bb:$dst), (BR_UNLESS bb_op:$dst, I32:$cond)>; -let Defs = [ARGUMENTS] in { - // TODO: SelectionDAG's lowering insists on using a pointer as the index for // jump tables, so in practice we don't ever use BR_TABLE_I64 in wasm32 mode // currently. @@ -194,5 +188,3 @@ [(catchret bb:$dst, bb:$from)], "", 0>; } } - -} // Defs = [ARGUMENTS] Index: lib/Target/WebAssembly/WebAssemblyInstrConv.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrConv.td +++ lib/Target/WebAssembly/WebAssemblyInstrConv.td @@ -13,8 +13,6 @@ /// //===----------------------------------------------------------------------===// -let Defs = [ARGUMENTS] in { - defm I32_WRAP_I64 : I<(outs I32:$dst), (ins I64:$src), (outs), (ins), [(set I32:$dst, (trunc I64:$src))], "i32.wrap/i64\t$dst, $src", "i32.wrap/i64", 0xa7>; @@ -51,15 +49,11 @@ 0xc4>; } // Predicates = [HasSignExt] -} // defs = [ARGUMENTS] - // Expand a "don't care" extend into zero-extend (chosen over sign-extend // somewhat arbitrarily, although it favors popular hardware architectures // and is conceptually a simpler operation). def : Pat<(i64 (anyext I32:$src)), (I64_EXTEND_U_I32 I32:$src)>; -let Defs = [ARGUMENTS] in { - // Conversion from floating point to integer instructions which don't trap on // overflow or invalid. defm I32_TRUNC_S_SAT_F32 : I<(outs I32:$dst), (ins F32:$src), (outs), (ins), @@ -218,5 +212,3 @@ [(set F64:$dst, (bitconvert I64:$src))], "f64.reinterpret/i64\t$dst, $src", "f64.reinterpret/i64", 0xbf>; - -} // Defs = [ARGUMENTS] Index: lib/Target/WebAssembly/WebAssemblyInstrExceptRef.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrExceptRef.td +++ lib/Target/WebAssembly/WebAssemblyInstrExceptRef.td @@ -12,8 +12,6 @@ /// //===----------------------------------------------------------------------===// -let Defs = [ARGUMENTS] in { - defm SELECT_EXCEPT_REF : I<(outs EXCEPT_REF:$dst), (ins EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond), (outs), (ins), @@ -23,8 +21,6 @@ "except_ref.select\t$dst, $lhs, $rhs, $cond", "except_ref.select", 0x1b>; -} // Defs = [ARGUMENTS] - def : Pat<(select (i32 (setne I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs), (SELECT_EXCEPT_REF EXCEPT_REF:$lhs, EXCEPT_REF:$rhs, I32:$cond)>; def : Pat<(select (i32 (seteq I32:$cond, 0)), EXCEPT_REF:$lhs, EXCEPT_REF:$rhs), Index: lib/Target/WebAssembly/WebAssemblyInstrFloat.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrFloat.td +++ lib/Target/WebAssembly/WebAssemblyInstrFloat.td @@ -45,8 +45,6 @@ !strconcat("f64.", name), f64Inst>; } -let Defs = [ARGUMENTS] in { - let isCommutable = 1 in defm ADD : BinaryFP; defm SUB : BinaryFP; @@ -69,8 +67,6 @@ defm TRUNC : UnaryFP; defm NEAREST : UnaryFP; -} // Defs = [ARGUMENTS] - // DAGCombine oddly folds casts into the rhs of copysign. Unfold them. def : Pat<(fcopysign F64:$lhs, F32:$rhs), (COPYSIGN_F64 F64:$lhs, (F64_PROMOTE_F32 F32:$rhs))>; @@ -81,8 +77,6 @@ def : Pat<(frint f32:$src), (NEAREST_F32 f32:$src)>; def : Pat<(frint f64:$src), (NEAREST_F64 f64:$src)>; -let Defs = [ARGUMENTS] in { - let isCommutable = 1 in { defm EQ : ComparisonFP; defm NE : ComparisonFP; @@ -92,8 +86,6 @@ defm GT : ComparisonFP; defm GE : ComparisonFP; -} // Defs = [ARGUMENTS] - // Don't care floating-point comparisons, supported via other comparisons. def : Pat<(seteq f32:$lhs, f32:$rhs), (EQ_F32 f32:$lhs, f32:$rhs)>; def : Pat<(setne f32:$lhs, f32:$rhs), (NE_F32 f32:$lhs, f32:$rhs)>; @@ -108,8 +100,6 @@ def : Pat<(setgt f64:$lhs, f64:$rhs), (GT_F64 f64:$lhs, f64:$rhs)>; def : Pat<(setge f64:$lhs, f64:$rhs), (GE_F64 f64:$lhs, f64:$rhs)>; -let Defs = [ARGUMENTS] in { - defm SELECT_F32 : I<(outs F32:$dst), (ins F32:$lhs, F32:$rhs, I32:$cond), (outs), (ins), [(set F32:$dst, (select I32:$cond, F32:$lhs, F32:$rhs))], @@ -119,8 +109,6 @@ [(set F64:$dst, (select I32:$cond, F64:$lhs, F64:$rhs))], "f64.select\t$dst, $lhs, $rhs, $cond", "f64.select", 0x1b>; -} // Defs = [ARGUMENTS] - // ISD::SELECT requires its operand to conform to getBooleanContents, but // WebAssembly's select interprets any non-zero value as true, so we can fold // a setne with 0 into a select. Index: lib/Target/WebAssembly/WebAssemblyInstrFormats.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrFormats.td +++ lib/Target/WebAssembly/WebAssemblyInstrFormats.td @@ -48,9 +48,11 @@ multiclass I pattern_r, string asmstr_r = "", string asmstr_s = "", bits<32> inst = -1> { + let Defs = [ARGUMENTS] in { let isCodeGenOnly = 1 in def "" : NI; def _S : NI; + } // Defs = [ARGUMENTS] } // For instructions that have no register ops, so both sets are the same. Index: lib/Target/WebAssembly/WebAssemblyInstrInfo.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrInfo.td +++ lib/Target/WebAssembly/WebAssemblyInstrInfo.td @@ -164,7 +164,8 @@ //===----------------------------------------------------------------------===// multiclass ARGUMENT { - let hasSideEffects = 1, Uses = [ARGUMENTS], isCodeGenOnly = 1 in + let hasSideEffects = 1, isCodeGenOnly = 1, + Defs = [], Uses = [ARGUMENTS] in defm ARGUMENT_#vt : I<(outs vt:$res), (ins i32imm:$argno), (outs), (ins i32imm:$argno), [(set vt:$res, (WebAssemblyargument timm:$argno))]>; @@ -175,8 +176,6 @@ defm "": ARGUMENT; defm "": ARGUMENT; -let Defs = [ARGUMENTS] in { - // get_local and set_local are not generated by instruction selection; they // are implied by virtual register uses and defs. multiclass LOCAL { @@ -266,8 +265,6 @@ "f64.const\t$res, $imm", "f64.const\t$imm", 0x44>; } // isMoveImm = 1, isAsCheapAsAMove = 1, isReMaterializable = 1 -} // Defs = [ARGUMENTS] - def : Pat<(i32 (WebAssemblywrapper tglobaladdr:$addr)), (CONST_I32 tglobaladdr:$addr)>; def : Pat<(i32 (WebAssemblywrapper texternalsym:$addr)), Index: lib/Target/WebAssembly/WebAssemblyInstrInteger.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrInteger.td +++ lib/Target/WebAssembly/WebAssemblyInstrInteger.td @@ -45,9 +45,6 @@ !strconcat("i64.", name), i64Inst>; } - -let Defs = [ARGUMENTS] in { - // The spaces after the names are for aesthetic purposes only, to make // operands line up vertically after tab expansion. let isCommutable = 1 in @@ -97,16 +94,12 @@ [(set I32:$dst, (setcc I64:$src, 0, SETEQ))], "i64.eqz \t$dst, $src", "i64.eqz", 0x50>; -} // Defs = [ARGUMENTS] - // Optimize away an explicit mask on a rotate count. def : Pat<(rotl I32:$lhs, (and I32:$rhs, 31)), (ROTL_I32 I32:$lhs, I32:$rhs)>; def : Pat<(rotr I32:$lhs, (and I32:$rhs, 31)), (ROTR_I32 I32:$lhs, I32:$rhs)>; def : Pat<(rotl I64:$lhs, (and I64:$rhs, 63)), (ROTL_I64 I64:$lhs, I64:$rhs)>; def : Pat<(rotr I64:$lhs, (and I64:$rhs, 63)), (ROTR_I64 I64:$lhs, I64:$rhs)>; -let Defs = [ARGUMENTS] in { - defm SELECT_I32 : I<(outs I32:$dst), (ins I32:$lhs, I32:$rhs, I32:$cond), (outs), (ins), [(set I32:$dst, (select I32:$cond, I32:$lhs, I32:$rhs))], @@ -116,8 +109,6 @@ [(set I64:$dst, (select I32:$cond, I64:$lhs, I64:$rhs))], "i64.select\t$dst, $lhs, $rhs, $cond", "i64.select", 0x1b>; -} // Defs = [ARGUMENTS] - // ISD::SELECT requires its operand to conform to getBooleanContents, but // WebAssembly's select interprets any non-zero value as true, so we can fold // a setne with 0 into a select. Index: lib/Target/WebAssembly/WebAssemblyInstrMemory.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrMemory.td +++ lib/Target/WebAssembly/WebAssemblyInstrMemory.td @@ -53,8 +53,6 @@ // We don't need a regPlusES because external symbols never have constant // offsets folded into them, so we can just use add. -let Defs = [ARGUMENTS] in { - // Defines atomic and non-atomic loads, regular and extending. multiclass WebAssemblyLoad { let mayLoad = 1 in @@ -73,8 +71,6 @@ defm LOAD_F32 : WebAssemblyLoad; defm LOAD_F64 : WebAssemblyLoad; -} // Defs = [ARGUMENTS] - // Select loads with no constant offset. class LoadPatNoOffset : Pat<(ty (kind I32:$addr)), (inst 0, 0, I32:$addr)>; @@ -144,8 +140,6 @@ def : LoadPatExternSymOffOnly; def : LoadPatExternSymOffOnly; -let Defs = [ARGUMENTS] in { - // Extending load. defm LOAD8_S_I32 : WebAssemblyLoad; defm LOAD8_U_I32 : WebAssemblyLoad; @@ -158,8 +152,6 @@ defm LOAD32_S_I64 : WebAssemblyLoad; defm LOAD32_U_I64 : WebAssemblyLoad; -} // Defs = [ARGUMENTS] - // Select extending loads with no constant offset. def : LoadPatNoOffset; def : LoadPatNoOffset; @@ -303,9 +295,6 @@ def : LoadPatExternSymOffOnly; def : LoadPatExternSymOffOnly; - -let Defs = [ARGUMENTS] in { - // Defines atomic and non-atomic stores, regular and truncating multiclass WebAssemblyStore { let mayStore = 1 in @@ -323,8 +312,6 @@ defm STORE_F32 : WebAssemblyStore; defm STORE_F64 : WebAssemblyStore; -} // Defs = [ARGUMENTS] - // Select stores with no constant offset. class StorePatNoOffset : Pat<(node ty:$val, I32:$addr), (inst 0, 0, I32:$addr, ty:$val)>; @@ -389,9 +376,6 @@ def : StorePatExternSymOffOnly; def : StorePatExternSymOffOnly; - -let Defs = [ARGUMENTS] in { - // Truncating store. defm STORE8_I32 : WebAssemblyStore; defm STORE16_I32 : WebAssemblyStore; @@ -399,8 +383,6 @@ defm STORE16_I64 : WebAssemblyStore; defm STORE32_I64 : WebAssemblyStore; -} // Defs = [ARGUMENTS] - // Select truncating stores with no constant offset. def : StorePatNoOffset; def : StorePatNoOffset; @@ -448,8 +430,6 @@ def : StorePatExternSymOffOnly; def : StorePatExternSymOffOnly; -let Defs = [ARGUMENTS] in { - // Current memory size. defm MEMORY_SIZE_I32 : I<(outs I32:$dst), (ins i32imm:$flags), (outs), (ins i32imm:$flags), @@ -493,8 +473,6 @@ 0x40>, Requires<[HasAddr32]>; -} // Defs = [ARGUMENTS] - def : Pat<(int_wasm_current_memory), (CURRENT_MEMORY_I32 0)>; def : Pat<(int_wasm_grow_memory I32:$delta), Index: lib/Target/WebAssembly/WebAssemblyInstrSIMD.td =================================================================== --- lib/Target/WebAssembly/WebAssemblyInstrSIMD.td +++ lib/Target/WebAssembly/WebAssemblyInstrSIMD.td @@ -55,7 +55,6 @@ "v128.const\t"#args, 0>; } -let Defs = [ARGUMENTS] in { defm "" : ConstVec; -} // Defs = [ARGUMENTS] // Create vector with identical lanes: splat def splat2 : PatFrag<(ops node:$x), (build_vector node:$x, node:$x)>;