From 9adb98520dbfd0e7790e232bd042799557b2c719 Mon Sep 17 00:00:00 2001 From: Mike Danes Date: Mon, 4 Jun 2018 00:50:17 +0300 Subject: Cleanup LOCKADD handling LOCKADD nodes are generated rather early and there's no reason for that: * The CORINFO_INTRINSIC_InterlockedAdd32/64 intrinsics are not actually used. Even if they would be used we can still import them as XADD nodes and rely on lowering to generate LOCKADD when needed. * gtExtractSideEffList transforms XADD into LOCKADD but this can be done in lowering. LOCKADD is an XARCH specific optimization after all. Additionally: * Avoid the need for special handling in LSRA by making GT_LOCKADD a "no value" oper. * Split LOCKADD codegen from XADD/XCHG codegen, attempting to use the same code for all 3 just makes things more complex. * The address is always in a register so there's no real need to create an indir node on the fly, the relevant emitter functions can be called directly. The last point above is actually a CQ issue - we always generate `add [reg], imm`, more complex address modes are not used. Unfortunately this problem starts early, when the importer spills the address to a local variable. If that ever gets fixed then we'll could probably generate a contained LEA in lowering. --- src/jit/gtlist.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/jit/gtlist.h') diff --git a/src/jit/gtlist.h b/src/jit/gtlist.h index dcfe3ba09c..bbd9bcbcd1 100644 --- a/src/jit/gtlist.h +++ b/src/jit/gtlist.h @@ -53,7 +53,7 @@ GTNODE(RELOAD , GenTreeCopyOrReload,0,GTK_UNOP) GTNODE(ARR_LENGTH , GenTreeArrLen ,0,GTK_UNOP|GTK_EXOP) // array-length GTNODE(INTRINSIC , GenTreeIntrinsic ,0,GTK_BINOP|GTK_EXOP) // intrinsics -GTNODE(LOCKADD , GenTreeOp ,0,GTK_BINOP) +GTNODE(LOCKADD , GenTreeOp ,0,GTK_BINOP|GTK_NOVALUE) GTNODE(XADD , GenTreeOp ,0,GTK_BINOP) GTNODE(XCHG , GenTreeOp ,0,GTK_BINOP) GTNODE(CMPXCHG , GenTreeCmpXchg ,0,GTK_SPECIAL) -- cgit v1.2.3