Fix consume-order checking in codegen.
authorPat Gavlin <pagavlin@microsoft.com>
Mon, 12 Dec 2016 19:34:26 +0000 (11:34 -0800)
committerPat Gavlin <pgavlin@gmail.com>
Tue, 13 Dec 2016 22:27:06 +0000 (14:27 -0800)
commitadf5d7dc89676534a4b6a31ab3fcfcd0fd2d7f16
treeb5540ad8336627aad2e7c486136eb65956c5f5ff
parent75a625faaddcd45b5ab396019dc1623dfe3b35c1
Fix consume-order checking in codegen.

The switch to LIR invalidated the correspondence between a node's
sequence number and the order in which it must be consumed with respect
to other nodes. This in turn made the consume-order checks during code
generation incorrect.

This change introduces a new field, `gtUseNum`, that is used during code
generation to check the order in which nodes are consumed. Re-enabling
these checks revealed a bug in code generation for locked instructions
on x86, which were consuming their operands out-of-order; this change
also contains a fix for that bug.

Fixes #7963.
src/jit/codegen.h
src/jit/codegenarm64.cpp
src/jit/codegenlinear.cpp
src/jit/codegenlinear.h
src/jit/codegenxarch.cpp
src/jit/gentree.h