[LLVMdev] Type Legalizer Question.

Sanjiv.Gupta at microchip.com Sanjiv.Gupta at microchip.com
Fri Oct 3 11:48:03 PDT 2008


> >>>> You can try just marking all i16 operations, other than load and
> >>>> store, as "expand". Would that work?
> >>>
> >>> Won't work; LLVM expects at least some basic operations, like add,
> >>> to
> >>> be legal in legal register types.
> >>
> >> That sounds like a bug, not a feature.
> >> -Chris
> >
> > The -enable-legalize-types infrastructure is entirely based upon
> > getVTAction (), so it will be completely ignored once we have i16
> > regclass,
> 
> I suspected that. But I wonder if that's going to be the approach or
> is this something we want to change.
> 


> Even after VT is legal, is it possible to check if the target still
> wants the result of this operation to be expanded?

What I meant is that illegal types are always expanded (based on getVTAction) besides the ones in which target is 
interested (based on setOperationAction ). So shouldn't the type legalizer consider both? Does this make sense?

- Sanjiv


> >
> > ditto with ExpandOp of LegalizeDAG.
> > And LegalizeDAG::LegalizeOp() allows very few things to be auto
> > expanded.
> 
> Really?! ExpandOp handles quite a lot of cases. And you can always add
> the ones you need. Most of them share the same mechanism (and common
> code).
> 
ExpandOp is called only if getVTAction() returns ::Expand, and also we
have

  assert(getTypeAction(VT) == Expand && "Not an expanded type!");

right in the beginning of the ExpandOp() function.


- Sanjiv

> Evan
> 
> 

_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20081003/6d54265c/attachment.html>


More information about the llvm-dev mailing list