This is an archive of the discontinued LLVM Phabricator instance.

Verifier: Reject non-float !fpmath
ClosedPublic

Authored by arsenm on Jun 24 2016, 11:29 AM.

Details

Reviewers
ab
Summary

Code already assumes this is float. getFPAccuracy() crashes on any other type.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 61815.Jun 24 2016, 11:29 AM
arsenm retitled this revision from to Verifier: Reject non-float !fpmath.
arsenm updated this object.
arsenm added a subscriber: llvm-commits.
ab added a subscriber: ab.Jun 24 2016, 1:43 PM

Add a LangRef comment?

lib/IR/Verifier.cpp
3672

Maybe something more explicit like "must have float type"?

arsenm updated this revision to Diff 61990.Jun 27 2016, 11:47 AM
arsenm marked an inline comment as done.

Update langref, change error message

ab accepted this revision.Jun 27 2016, 11:52 AM
ab added a reviewer: ab.

Thanks, LGTM

lib/IR/Verifier.cpp
3671

Looking at this again: perhaps cleaner to do CFP0->getType()->isFloatTy() ?

This revision is now accepted and ready to land.Jun 27 2016, 11:52 AM
arsenm added inline comments.Jun 27 2016, 12:20 PM
lib/IR/Verifier.cpp
3671

Since the other condition needs the APFloat anyway maybe it's more consistent to use it to check all the conditions?

ab added inline comments.Jun 27 2016, 12:25 PM
lib/IR/Verifier.cpp
3671

Eh, fair enough; lgtm

arsenm closed this revision.Jun 27 2016, 12:50 PM

r273912