[cfe-dev] Disable integer promotion

Dilan Manatunga via cfe-dev cfe-dev at lists.llvm.org
Thu May 26 18:50:12 PDT 2016


Is there a way to disable integer promotion when performing math
operations. For example, when compiling a statement such as this:
int8_t a  = 1;
int8_t b = 2;
int8_t c = a + b

The LLVM IR will be:
%x = sext i32 %a to i32
%y = sext i32 %b to i32
%z = add nsw i32 %x, %y
%c = trunc i32 %z to i16

Instead, it would simply compile to:
$c = add nsw i32 %z, $y

-Dilan Manatunga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160527/4a7920ab/attachment.html>


More information about the cfe-dev mailing list