[llvm-commits] Patch: avoid legalization assert
Mon Ping Wang
monping at apple.com
Fri Jan 30 10:52:26 PST 2009
Hi Duncan,
Yes, you have it right. In general, its better to run vector code
using the SSE instructions and avoid using MMX instructions. By using
-disable-mmx, we disable MMX registers and make i64 to no longer be a
legal type but leave v2i64 as a legal SSE2+ type. Since X86 doesn't
have an 64 bit divide instruction and we don't have a vector form for
the library function, we end up scalarizing it and calling library
routine which introduces those expression nodes with i64 and then hit
the assert. It is a tricky case and it is one I wonder could happen in
other cases (probably rarely) where we have library routines that uses
illegal types that need be promoted.
-- Mon Ping
On Jan 30, 2009, at 7:11 AM, Duncan Sands wrote:
> Hi Mon Ping, if I understand right the problem is that v2i64 is legal,
> but i64 is not, and that when we try to scalarize this
> 0x2b1d9c8: v2i64 = sdiv 0x2b1ddc8, 0x2b1dfc8
> into a pair of libcalls, we end up with expressions in terms of the
> elements (i.e. of i64 type) but those types aren't legal. The
> point of running llc with -disable-mmx is that there is then no
> sdiv vector instruction I suppose. Hmmm, tricky :)
>
> Ciao,
>
> Duncan.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list