Fix LowerSDIV24

Matt Arsenault arsenm2 at
Wed Jul 9 23:44:42 PDT 2014

On Jul 9, 2014, at 11:15 PM, Matt Arsenault <arsenm2 at> wrote:

> On Jun 26, 2014, at 3:43 PM, Jan Vesely <jan.vesely at> wrote:
>> On Wed, 2014-06-25 at 21:48 -0700, Matt Arsenault wrote:
>>> Hi,
>>> These reenable LowerSDIV24 to optimize division when it’s know
>>> converting to float won’t lose precision + piglit test cases that
>>> should break for values where this isn’t OK
>> Have you considered applying this to SDVIREM?
>> getting Rem part is easy, we only need MULADD (before or after
>> conversion to INT).
> I think that would be pointless. Expanded SREM with a custom SDIV will expand to be the same X - Y * (X / Y), and then the division will be handled this way. I’ll add a test that shows this ends up getting used with stem

Actually, since SDIVREM is custom now, that is chosen first to expand SREM over X - Y * (X / Y). I can either move this into a LowerSDIVREM, and add the expansion there, or move the existing divrems to be just div if all they are doing for the rem part is this.

More information about the llvm-commits mailing list