diff options
author | Pat Gavlin <pagavlin@microsoft.com> | 2017-06-20 18:22:45 -0700 |
---|---|---|
committer | Pat Gavlin <pagavlin@microsoft.com> | 2017-06-24 14:10:19 -0700 |
commit | 04668c8a76da2b1ee07b48e00ae0376ddfbad960 (patch) | |
tree | 76e044caadb00e43853ba89b93aa329a2bef0136 /src/jit/lir.cpp | |
parent | ab7f3407fa9a03110157ee659b5145a8f6e392ca (diff) | |
download | coreclr-04668c8a76da2b1ee07b48e00ae0376ddfbad960.tar.gz coreclr-04668c8a76da2b1ee07b48e00ae0376ddfbad960.tar.bz2 coreclr-04668c8a76da2b1ee07b48e00ae0376ddfbad960.zip |
Maintain `LIR::IsUnusedValue` in the backend.
This flag indicates whether or not the SDSU temp produced by a node is
ever read. This information is needed by the register allocator, but is
also useful in other parts of the compiler (for example, `TryGetUse` can
return immediately if this flag is set). Setting this flag properly in
rationalize and maintaining it through decomposition and lowering allows
us to remove an IR walk immediately prior to LSRA.
Diffstat (limited to 'src/jit/lir.cpp')
-rw-r--r-- | src/jit/lir.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/jit/lir.cpp b/src/jit/lir.cpp index b6c36ca7ed..074e0e4639 100644 --- a/src/jit/lir.cpp +++ b/src/jit/lir.cpp @@ -972,11 +972,19 @@ void LIR::Range::InsertAtEnd(Range&& range) // Arguments: // node - The node to remove. Must be part of this range. // -void LIR::Range::Remove(GenTree* node) +void LIR::Range::Remove(GenTree* node, bool markOperandsUnused) { assert(node != nullptr); assert(Contains(node)); + if (markOperandsUnused) + { + for (GenTree* operand : node->Operands()) + { + operand->gtLIRFlags |= Flags::IsUnusedValue; + } + } + GenTree* prev = node->gtPrev; GenTree* next = node->gtNext; |