<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jun 15, 2011, at 9:39 AM, Chad Rosier wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; 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-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div><blockquote type="cite"><br class="Apple-interchange-newline">x86 isel matches "shl undef, 1" to "add undef, undef" but then two different registers are used for the two undef operands, and the result is that the lsb is _not_ zero.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I think Chad's fix is a good solution.  Otherwise, if we really want to assert that any operation with an undef input has an undef result, then SimplifyDemandedBits will have to do something more complicated than just inserting undefs as it does in the code above.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">BTW, Chad, regarding the comment in your testcase, TargetLoweringOpt is not a pass.  It's just a struct to hold some information used by optimizations in the DAG combiner.<br></blockquote><blockquote type="cite"><br></blockquote><br>Ah, yes.  Thanks for the clarification.</div></span></blockquote></div><br><div>I agree that Chad's fix is the right way to go.</div><div><br></div><div><blockquote type="cite">How do you suggest rewriting the following pattern so it is safe?<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">def : Pat<(shl GR32:$src1, (i8 1)), (ADD32rr GR32:$src1, GR32:$src1)>;<br></blockquote></div><div><br></div><div>Is this a real problem?  We don't do any undef processing after machineinstrs are formed.</div><div><br></div><div>-Chris</div></body></html>