Andrew Lenharth
2010-Mar-17 21:17 UTC
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
On Wed, Mar 17, 2010 at 3:54 PM, Eli Friedman <eli.friedman at gmail.com> wrote:> On Wed, Mar 17, 2010 at 1:32 PM, Sergey Yakoushkin > <sergey.yakoushkin at gmail.com> wrote: >> I'm building tool-chain for processor without integer MUL. >> So, I've defined __mulsi3 for integer multiplication (int32). >> >> Now I've got a problem with int64 multiplication which is implemented >> in libgcc2.c. >> Segfualt due to infinite recursion in i64 soft multiplication >> (libgcc2, __muldi3). > > See http://llvm.org/bugs/show_bug.cgi?id=3101 which is essentially the > same issue.Alpha has the same problem with 128 Ints, in about the same functions.
Sergey Yakoushkin
2010-Mar-17 21:57 UTC
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
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? Can I disable only one particular pass which does this promotion from i32 to i64 using some LLVM-GCC option? Are there other libgcc functions affected by this optimization? Regards, Sergey Y.
Andrew Lenharth
2010-Mar-17 22:05 UTC
[LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
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
Apparently Analagous Threads
- [LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
- [LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
- [LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
- [LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3
- [LLVMdev] llvm-gcc promotes i32 mul to i64 inside __muldi3