[llvm-dev] Little explanation of this behaviour

Lorenzo Laneve via llvm-dev llvm-dev at lists.llvm.org
Thu Apr 14 16:23:09 PDT 2016


Thanks, so what’s the point of these rules? Do they grant something like safety or faster execution?

> C and C++ have what's called "integer promotion rules", which apply to
> most expressions involving types smaller than int and insert an
> implicit promotion to int before anything else happens (in this case
> another implicit conversion to double).


> 
>> Can a sitofp i8 %3 to double be done or is it wrong?
> 
> That's fine, in fact LLVM optimizes the function to use that itself.

Are you saying that instruction will be optimized by LLVM in this case?


More information about the llvm-dev mailing list