JIT: fix def tree for CSE locals going into SSA (dotnet/coreclr#27301)
authorAndy Ayers <andya@microsoft.com>
Mon, 21 Oct 2019 21:49:51 +0000 (14:49 -0700)
committerGitHub <noreply@github.com>
Mon, 21 Oct 2019 21:49:51 +0000 (14:49 -0700)
When putting a new single-def CSE local into SSA, we need to set the def tree
to the LHS of the GT_ASG, not the GT_ASG.

Commit migrated from https://github.com/dotnet/coreclr/commit/90e59bed1cf8c513d42fc7c660953e7d46057a4e

src/coreclr/src/jit/optcse.cpp

index 55fc666d7bc8b55e1ef9cc511b264fe6b17c4290..432e85be668987b6dc33b49ffd6aa3908f236a8e 100644 (file)
@@ -2381,7 +2381,7 @@ public:
 
                     ssaVarDsc->m_vnPair        = val->gtVNPair;
                     ssaVarDsc->m_defLoc.m_blk  = blk;
-                    ssaVarDsc->m_defLoc.m_tree = asg;
+                    ssaVarDsc->m_defLoc.m_tree = asg->AsOp()->gtOp1;
                 }
 
                 /* Create a reference to the CSE temp */