Promote MVT::f32 load/store to MVT::i32 cause infinite loop in LegalizeDAG?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Promote MVT::f32 load/store to MVT::i32 cause infinite loop in LegalizeDAG?

Francois Pichet
On my target store/load of f32 or i32 are equivalents.
Previously I had duplicate instructions def in .td to map f32 and i32 to the same opcode.

I deleted all that and I instead tried a new approach (to simplify things) :

  setOperationAction(ISD::STORE, MVT::f32, Promote);
  AddPromotedToType(ISD::STORE, MVT::f32, MVT::i32);
  setOperationAction(ISD::LOAD, MVT::f32, Promote);
  AddPromotedToType(ISD::LOAD, MVT::f32, MVT::i32);

Now SelectionDAGLegalize::LegalizeDAG() get stuck into an infinite loop. What is going on?

I still have the following:(but I think that's fine)
  addRegisterClass(MVT::f32, &Opus::GR32RegClass);

Thanks.
(My LLVM is ~3 months old)

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Promote MVT::f32 load/store to MVT::i32 cause infinite loop in LegalizeDAG?

Tom Stellard-3
On Mon, Aug 05, 2013 at 02:09:58PM -0400, Francois Pichet wrote:

> On my target store/load of f32 or i32 are equivalents.
> Previously I had duplicate instructions def in .td to map f32 and i32 to
> the same opcode.
>
> I deleted all that and I instead tried a new approach (to simplify things) :
>
>   setOperationAction(ISD::STORE, MVT::f32, Promote);
>   AddPromotedToType(ISD::STORE, MVT::f32, MVT::i32);
>   setOperationAction(ISD::LOAD, MVT::f32, Promote);
>   AddPromotedToType(ISD::LOAD, MVT::f32, MVT::i32);
>
> Now SelectionDAGLegalize::LegalizeDAG() get stuck into an infinite loop.
> What is going on?
>
> I still have the following:(but I think that's fine)
>   addRegisterClass(MVT::f32, &Opus::GR32RegClass);

Have you specified a register class for MVT::i32?  If not, I think that
may be your problem.

-Tom

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Promote MVT::f32 load/store to MVT::i32 cause infinite loop in LegalizeDAG?

Francois Pichet



On Mon, Aug 5, 2013 at 2:25 PM, Tom Stellard <[hidden email]> wrote:
On Mon, Aug 05, 2013 at 02:09:58PM -0400, Francois Pichet wrote:
> On my target store/load of f32 or i32 are equivalents.
> Previously I had duplicate instructions def in .td to map f32 and i32 to
> the same opcode.
>
> I deleted all that and I instead tried a new approach (to simplify things) :
>
>   setOperationAction(ISD::STORE, MVT::f32, Promote);
>   AddPromotedToType(ISD::STORE, MVT::f32, MVT::i32);
>   setOperationAction(ISD::LOAD, MVT::f32, Promote);
>   AddPromotedToType(ISD::LOAD, MVT::f32, MVT::i32);
>
> Now SelectionDAGLegalize::LegalizeDAG() get stuck into an infinite loop.
> What is going on?
>
> I still have the following:(but I think that's fine)
>   addRegisterClass(MVT::f32, &Opus::GR32RegClass);

Have you specified a register class for MVT::i32?  If not, I think that
may be your problem.

-Tom

Yes I have, f32 and i32 map to the same register class:
  addRegisterClass(MVT::i32, &Opus::GR32RegClass);
 


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Promote MVT::f32 load/store to MVT::i32 cause infinite loop in LegalizeDAG?

Tom Stellard-3
On Mon, Aug 05, 2013 at 02:32:57PM -0400, Francois Pichet wrote:

> On Mon, Aug 5, 2013 at 2:25 PM, Tom Stellard <[hidden email]> wrote:
>
> > On Mon, Aug 05, 2013 at 02:09:58PM -0400, Francois Pichet wrote:
> > > On my target store/load of f32 or i32 are equivalents.
> > > Previously I had duplicate instructions def in .td to map f32 and i32 to
> > > the same opcode.
> > >
> > > I deleted all that and I instead tried a new approach (to simplify
> > things) :
> > >
> > >   setOperationAction(ISD::STORE, MVT::f32, Promote);
> > >   AddPromotedToType(ISD::STORE, MVT::f32, MVT::i32);
> > >   setOperationAction(ISD::LOAD, MVT::f32, Promote);
> > >   AddPromotedToType(ISD::LOAD, MVT::f32, MVT::i32);
> > >
> > > Now SelectionDAGLegalize::LegalizeDAG() get stuck into an infinite loop.
> > > What is going on?
> > >
> > > I still have the following:(but I think that's fine)
> > >   addRegisterClass(MVT::f32, &Opus::GR32RegClass);
> >
> > Have you specified a register class for MVT::i32?  If not, I think that
> > may be your problem.
> >
> > -Tom
> >
>
> Yes I have, f32 and i32 map to the same register class:
>   addRegisterClass(MVT::i32, &Opus::GR32RegClass);

Ok, that's strange.  You may have to step through the code to see what
is happening.  The R600 target does the exact same promotion with f32
loads and stores (see R600ISelLowering.cpp), and it works fine, so you
may want to compare and see what you are doing differently.

-Tom
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev