<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"><base href="x-msg://32/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Anat, </div><div><br></div><div>The assertion needs to be there.  This bug happens when a value is returned from the type-legalizer handlers, and is RAUW (replace-all-uses-with).  The values to be replaced are saved in CSE map. Often, changing these value trigger additional RAUW calls. The RAUW invocations call the type-legalizer callback which need to manage the node state (new/analyzed/etc).  The problem is that multiple invocation of RAUW (due to CSE changes) sometimes keep the type-legalizer data-structure in an unstable state. I don't know of an easy fix to the problem. Here is a quick workaround: When you are type-legalizing values,  try not to use the old un-legalized values. I found that this reduces the cases in which these bugs occur.  </div><div><br></div><div>Nadav</div><div><br></div><br><div><div>On Aug 16, 2012, at 11:39 PM, "Shemer, Anat" <<a href="mailto:anat.shemer@intel.com">anat.shemer@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><font face="Verdana" size="2"><span style="font-size: 10pt; "><div>Hi,</div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><div>If you are familiar with LegalizeTypes I will be glad if you can help me with the following scenario.</div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><div>I’m debugging some ll test that fails with an assertion in “void DAGTypeLegalizer::RemapValue(SDValue &N)” because it does not expect that a remap to a new node exists.</div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><div>However looking at the code for a while this seems to be a valid case. I see that many times nodes are added to ReplacedValues map as a value when their NodeID is 0, and therefore they might become a NewNode later. As soon as they become NewNode they are analyzed in AnalyzeNewNode() and in this process, which recurs through the new node operands, it’s possible to reach RemapValue and find there the node as a NewNode. That’s the scenario in which my test fails.</div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><div>But I probably miss something because normally this assertion is not hit.</div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><ul style="margin: 0px; padding-left: 36pt; "><li>Is this assertion correct?</li><li>What is wrong with the scenario that I describe? Or why doesn’t it happen more often?</li></ul><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><div>BTW, I searched in LLVM archives and saw that this assertion was removed in 2008 but returned later. but I couldn’t find an explanation how this should work.</div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><div>Thanks, Anat</div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div><div><font face="Calibri" size="2"><span style="font-size: 11pt; "> </span></font></div></span></font><p>---------------------------------------------------------------------<br>Intel Israel (74) Limited</p><p>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.</p>_______________________________________________<br>LLVM Developers mailing list<br><a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br></div></blockquote></div><br></body></html>