[LLVMdev] Shouldn't DAGCombine insert legal nodes?

Chris Lattner clattner at apple.com
Tue Jan 20 14:22:30 PST 2009


On Jan 20, 2009, at 12:32 PM, Scott Michel wrote:

> Eli:
>
> Legal constants would be all well and good for most platforms. I
> don't think that CellSPU is alone in its support for i64 constants
> (in fact, the comment in DAGCombine says that the 64-bit constant is
> inserted to "avoid a constant pool spill").
>
> In many respects, DAGCombine and operation Legalize are co-routines,
> not separate passes.

i32 immediates are not materializable in a single instruction on  
PowerPC or ARM.  They claims that they are legal and then matches them  
with the appropriate expansion.  Can you do a similar thing on Cell?

In any case, the bug fix is probably really simple: the dag combine  
xform for fabs probably just needs to check to see if ISD::CONSTANT is  
legal if post-legalize

-chris



More information about the llvm-dev mailing list