[LLVMdev] Type Legalizer Question.
Sanjiv.Gupta at microchip.com
Sanjiv.Gupta at microchip.com
Thu Oct 2 11:21:06 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?
> >
> > 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
>
>
More information about the llvm-dev
mailing list