[llvm-dev] Signed Division and InstCombine

Dilan Manatunga via llvm-dev llvm-dev at lists.llvm.org
Tue May 31 15:34:13 PDT 2016


I was looking through the InstCombine pass, and I was wondering why signed
division is not considered a valid operation to combine in the
canEvaluateTruncated function. This means, given the following code:

%conv = sext i16 %0 to i32
%conv1 = sext i16 %1 to i32
%div = sdiv i32 %conv, %conv1
%conv2 = trunc i32 %div to i16

* Assume %0 and %1 are registers created from simple 16-bit loads.

We cannot reduce the sequence to:
%div = sdiv i16 %0 %1

What is the reason for the exclusion of sdiv from the operations considered
valid for execution in a truncated format.

Thanks,
-Dilan Manatunga
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160531/2d3ea4b6/attachment.html>


More information about the llvm-dev mailing list