[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3

Andrew Lenharth andrewl at lenharth.org
Wed Mar 17 15:05:44 PDT 2010


On Wed, Mar 17, 2010 at 4:57 PM, Sergey Yakoushkin
<sergey.yakoushkin at gmail.com> wrote:
> Thanks, yes, I'm facing the same issue.
>
> Hm... seems there are no simple fixes.
> I have to do one more i64 mul implementation to workaround aggressive
> optimizations.
> Is that correct? Is this the only way?

This shouldn't be necessary, IMO.  If you were going to implement it,
then the correct thing to do would be to have generic selection dag
lowering of large multiplies, which renders the library mostly
useless.

> Can I disable only one particular pass which does this promotion from
> i32 to i64 using some LLVM-GCC option?

Not easily as far as I know.

> Are there other libgcc functions affected by this optimization?

Any soft int stuff that lowering hasn't already implemented.

Andrew



More information about the llvm-dev mailing list