summaryrefslogtreecommitdiff
path: root/src/jit/flowgraph.cpp
diff options
context:
space:
mode:
authorEgor Chesakov <t-egche@microsoft.com>2016-08-23 17:35:10 -0700
committerEgor Chesakov <t-egche@microsoft.com>2016-08-26 09:51:35 -0700
commit12f327477b6c1e18b6db7d0b2ec3445ef3997c17 (patch)
tree0ded28496e075b3a41b022e63390313634fd9fb4 /src/jit/flowgraph.cpp
parent7234a53b0e50c330c8e438c36acced507a83e5e0 (diff)
downloadcoreclr-12f327477b6c1e18b6db7d0b2ec3445ef3997c17.tar.gz
coreclr-12f327477b6c1e18b6db7d0b2ec3445ef3997c17.tar.bz2
coreclr-12f327477b6c1e18b6db7d0b2ec3445ef3997c17.zip
fgOptimizeBranch loses bbFlags while duplicating the block #6886
1. When `fgOptimizeBranch` procedure duplicates the conditional basic block it does not copy flags of the `bDest` block to the `bJump` block. For example, if a flag `BBF_HAS_NEWOBJ` was set in `bDest`, but not in `bJump` when the branch optimization is done the `bbFlags` of `bJump` will not reflect the fact that we have new object construction in this block. 2. In `DEBUG` always check if `bbFlags` has `BBF_HAS_NEWOBJ` flag set if at least one `GT_ALLOCOBJ` canonical node found. This helps to identify situations when compiler loses `BBF_HAS_NEWOBJ` flag.
Diffstat (limited to 'src/jit/flowgraph.cpp')
-rw-r--r--src/jit/flowgraph.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/jit/flowgraph.cpp b/src/jit/flowgraph.cpp
index a1d4aafc4e..ced582b30a 100644
--- a/src/jit/flowgraph.cpp
+++ b/src/jit/flowgraph.cpp
@@ -14170,6 +14170,10 @@ bool Compiler::fgOptimizeBranch(BasicBlock* bJump)
/* Mark the jump dest block as being a jump target */
bJump->bbJumpDest->bbFlags |= BBF_JMP_TARGET | BBF_HAS_LABEL;
+ // We need to update the following flags of the bJump block if they were set in the bbJumpDest block
+ bJump->bbFlags |= (bJump->bbJumpDest->bbFlags
+ & (BBF_HAS_NEWOBJ | BBF_HAS_NEWARRAY | BBF_HAS_NULLCHECK | BBF_HAS_IDX_LEN | BBF_HAS_VTABREF));
+
/* Update bbRefs and bbPreds */
// bJump now falls through into the next block