This is an archive of the discontinued LLVM Phabricator instance.

change an assert when generating fmuladd to an ordinary 'if' check (PR25719)
ClosedPublic

Authored by spatel on Dec 2 2015, 3:46 PM.

Details

Summary

We don't want to generate fmuladd if there's a use of the fmul expression, but this shouldn't be an assert.

The test case is derived from the commit message for r253337:
http://reviews.llvm.org/rL253337

That commit reverted r253269:
http://reviews.llvm.org/rL253269

...but the bug exists independently of the default fp-contract setting. It just became easier to hit with that change.

PR25719:
https://llvm.org/bugs/show_bug.cgi?id=25719

Diff Detail

Repository
rL LLVM

Event Timeline

spatel updated this revision to Diff 41685.Dec 2 2015, 3:46 PM
spatel retitled this revision from to change an assert when generating fmuladd to an ordinary 'if' check (PR25719).
spatel updated this object.
spatel added reviewers: lhames, scanon, hfinkel, klimek.
spatel added a subscriber: cfe-commits.
scanon edited edge metadata.Dec 2 2015, 4:11 PM

This is mostly http://reviews.llvm.org/D14891 with a test case added, but D14891 also fixed a second very minor issue: that the "else if" should just be "if". Also, majnemer made a few style suggestions there that it would be nice to adopt. Either way, we should merge the two patches. This can be the canonical one if you want to update it.

spatel added a comment.Dec 2 2015, 5:09 PM

This is mostly http://reviews.llvm.org/D14891 with a test case added, but D14891 also fixed a second very minor issue: that the "else if" should just be "if". Also, majnemer made a few style suggestions there that it would be nice to adopt. Either way, we should merge the two patches. This can be the canonical one if you want to update it.

Oops - too much mail and obviously missed your patch. But sure, I'll update with the suggested changes.

spatel updated this revision to Diff 41699.Dec 2 2015, 5:16 PM
spatel edited edge metadata.

Patch updated with suggestions from D14891:

  1. Changed 'else if' to plain 'if' for RHS check.
  2. Used 'auto*' for dyn_casted vars.
  3. Replaced 'getNUses() == 0' with 'use_empty()'.
This revision was automatically updated to reflect the committed changes.