[LLVMdev] Lowering operations to 8-bit!

Chris Lattner sabre at nondot.org
Fri Sep 28 17:01:16 PDT 2007


On Sep 28, 2007, at 4:53 PM, <Alireza.Moshtaghi at microchip.com>  
<Alireza.Moshtaghi at microchip.com> wrote:

> ExpandOp is not called at all.
> In SelectionDAGLegalize::HandleOp() only the ValueType is  
> considered in
> the switch statement to decide if it is legal or promote or expand.
> As I trace back (correct me if I'm wrong) these values are set in
> TargetLowering::computeRegisterProperties() and it is based on the
> largest register class (in my case the smallest possible pointer size,
> 16-bit)
> So it reduces everything down to 16-bit and pretty much ignores the  
> fact
> that ADD of i16 is supposed to be expanded.
>
> Am I doing the right analysis?

Yes.  It sounds like the codegen is assuming the pointer type is  
valid in computeRegisterProperties or something.  Somehow i16 is  
getting marked as legal.

-Chris



More information about the llvm-dev mailing list