<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Dan,<div><br></div><div>It’s probably legalization.</div><div><br></div><div>-Jim</div><div><br><div><div>On May 13, 2013, at 12:35 PM, Dan <<a href="mailto:westdac@gmail.com">westdac@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div><br class="Apple-interchange-newline"><br></div><div>I've inherited some target code, but there is no SELECT lowering in my target.  But somewhere/somehow SELECT is being transformed into a predicated move.  I've traced SELECT everywhere in Codegen/SelectionDAG.</div><div><br></div><div>Any ideas on tracking this down to the point in Codegen lowering/dag-conversion to a predicated series? Again, I do not have a lowering rule in my target for SELECT.</div><div><br></div><div>If I do a IR DUMP Before Expand ISel Pseudo-instruction, I will get a CMOV listed in the code (shown below).  But I cannot track down how/where the CMOV is being generated from the SELECT.</div><div><br></div><div>Help?</div><div><br></div><div>Here's the basic code and llvm IR:</div><div><br></div><div><div style="font-family: arial, sans-serif; font-size: 13px;">#include <stdio.h></div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;">int a = 0;</div><div style="font-family: arial, sans-serif; font-size: 13px;">int b = 0;</div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;">int main() {</div><div style="font-family: arial, sans-serif; font-size: 13px;">  a = (b > 0) ? 23 : 8;</div><div style="font-family: arial, sans-serif; font-size: 13px;">  return 0;</div><div style="font-family: arial, sans-serif; font-size: 13px;">}</div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;">; ModuleID = 'try.c'</div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;">@a = global i32 0, align 4</div><div style="font-family: arial, sans-serif; font-size: 13px;">@b = global i32 0, align 4</div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;">define i32 @main() nounwind {</div><div style="font-family: arial, sans-serif; font-size: 13px;">entry:</div><div style="font-family: arial, sans-serif; font-size: 13px;">  %0 = load i32* @b, align 4</div><div style="font-family: arial, sans-serif; font-size: 13px;">  %cmp = icmp sgt i32 %0, 0</div><div style="font-family: arial, sans-serif; font-size: 13px;">  %cond = select i1 %cmp, i32 23, i32 8</div><div style="font-family: arial, sans-serif; font-size: 13px;">  store i32 %cond, i32* @a, align 4</div><div style="font-family: arial, sans-serif; font-size: 13px;">  ret i32 0</div><div style="font-family: arial, sans-serif; font-size: 13px;">}</div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;"><div># *** IR Dump Before Expand ISel Pseudo-instructions ***:</div><div># Machine code for function main: SSA</div><div>Function Live Outs: %r8</div><div><br></div><div>BB#0: derived from LLVM BB %entry</div><div>        %vreg0<def> = MOVL_GA <ga:@b>; GR:%vreg0</div><div>        %vreg1<def> = LDSHri %vreg0<kill>, 0; mem:LD4[@b] GR:%vreg1,%vreg0</div><div>        %vreg2<def> = MOVIMM21 0; GR:%vreg2</div><div>        %vreg3<def> = CMPGT %vreg1<kill>, %vreg2; PR:%vreg3 GR:%vreg1,%vreg2</div><div>        %vreg4<def> = MOVIMM21 8; GR:%vreg4</div><div>        %vreg5<def> = MOV %vreg4<kill>; GR:%vreg5,%vreg4</div><div>        %vreg6<def> = MOVIMM21 23; GR:%vreg6</div><div>        %vreg7<def,tied1> = CMOV %vreg5<tied0>, %vreg6<kill>, %vreg3<kill>; GR:%vreg7,%vreg5,%vreg6 PR:%vreg3</div><div>        %vreg8<def> = MOVL_GA <ga:@a>; GR:%vreg8</div><div>        STHri %vreg8<kill>, 0, %vreg7<kill>; mem:ST4[@a] GR:%vreg8,%vreg7</div><div>        %r8<def> = COPY %vreg2; GR:%vreg2</div><div>        RET %r31<imp-use></div><div><br></div><div># End machine code for function main.</div></div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div><div style="font-family: arial, sans-serif; font-size: 13px;"><br></div></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">LLVM Developers mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="mailto:LLVMdev@cs.uiuc.edu" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">LLVMdev@cs.uiuc.edu</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;"><span class="Apple-converted-space"> </span>        </span><a href="http://llvm.cs.uiuc.edu/" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">http://llvm.cs.uiuc.edu</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a></blockquote></div><br></div></body></html>