Page MenuHomePhabricator

Use ComputeNumSignBits to fold (sext_inreg (trunc x)) -> (trunc x)

Authored by vkalintiris on Feb 2 2016, 4:09 AM.



If x's number of sign bits is greater than the number of sign bits
introduced by the sext_inreg, then we can skip the sign extension.

I can't think of any way to test this. I tried to using csmith without any
luck. This patch is intended for D16220.

Diff Detail

Event Timeline

vkalintiris updated this revision to Diff 46637.Feb 2 2016, 4:09 AM
vkalintiris retitled this revision from to Use ComputeNumSignBits to fold (sext_inreg (trunc x)) -> (trunc x).
vkalintiris updated this object.
vkalintiris added a reviewer: dsanders.
vkalintiris added a subscriber: llvm-commits.
vkalintiris abandoned this revision.Jun 5 2016, 10:40 AM