This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix incorrect CSEL node created
ClosedPublic

Authored by rogfer01 on Nov 8 2016, 5:19 AM.

Details

Summary

Under -enable-unsafe-fp-math SELECT_CC lowering in AArch64
transforms floating point comparisons of the form "a == 0.0 ? 0.0 : x" to
"a == 0.0 ? a : x". But it incorrectly assumes that 'x' and 'a' have
the same type which can lead to a wrong CSEL node that fails later
due to nonsensical copies.

This issue was introduced in https://reviews.llvm.org/rL284531

Diff Detail

Event Timeline

rogfer01 updated this revision to Diff 77173.Nov 8 2016, 5:19 AM
rogfer01 retitled this revision from to [AArch64] Fix incorrect CSEL node created.
rogfer01 updated this object.
rogfer01 added a subscriber: llvm-commits.
jmolloy accepted this revision.Nov 8 2016, 5:21 AM
jmolloy edited edge metadata.

Hi Roger,

This looks like a sensible fix - thanks for doing this!

If I understand right, the reason your testcase doesn't have a FileCheck invocation is because the previous behaviour was a crash. Could you please mention this as a comment in the testcase?

With that fixed, LGTM.

James

This revision is now accepted and ready to land.Nov 8 2016, 5:21 AM
rogfer01 updated this revision to Diff 77176.Nov 8 2016, 5:29 AM
rogfer01 edited edge metadata.

Mention in testcase that we are checking that we do not crash with the given input.

This revision was automatically updated to reflect the committed changes.