[cfe-dev] Issue with Clang on Windows and compiler-rt builtins

Rong Jie Loo via cfe-dev cfe-dev at lists.llvm.org
Sun Jan 7 18:55:20 PST 2018


>> When __int128 operations are used, Clang on Windows generate calls to
>> compiler-rt builtins (__udivti3 etc.) instead of generating inline
>> optimized assembly directly.
>
> LLVM does not inline division or modulo for 128bit operands. Way too
> much code.

Thanks for the pointer.

After checking with https://godbolt.org/g/HN7wf5 , I realized my mistake. GCC
and Clang on Linux will constant fold __int128 if possible, otherwise __udivti3
etc. function calls will still be emitted.

I submitted a patch to compiler-rt for this at https://reviews.llvm.org/D41813.
Hope I am doing it correctly.

Rong Jie



More information about the cfe-dev mailing list