[cfe-dev] Question about ASTContext::getPromotedIntegerType() function

Eli Friedman eli.friedman at gmail.com
Tue Jul 16 11:00:45 PDT 2013


On Tue, Jul 16, 2013 at 9:56 AM, JinGu Kang <jingu at codeplay.com> wrote:
> Hi Eli,
>
> I appreciate your comment. It's really helpful to understand the code.
>
> How do you feel about generating "sdiv" instruction on previous example?

How else would you divide two signed integers?  Instcombine knows how
to optimize it to a udiv.  I mean, we could hack an optimization into
clang, but it would be the same optimization instcombine does, and
there isn't much point to optimizing the performance of -O0 code.

-Eli



More information about the cfe-dev mailing list