This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Add tests for checking isnan patterns
ClosedPublic

Authored by lenary on Apr 27 2020, 2:31 AM.

Details

Summary

I worked on adding some SelectionDag patterns to address code generated by these
examples, which came out of some differential testing against GCC. The pattern
additions will be in a follow-up patch.

Diff Detail

Event Timeline

lenary created this revision.Apr 27 2020, 2:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 2:31 AM
asb accepted this revision.Apr 30 2020, 3:32 AM

LGTM. Minor nit: using %0 and %2 as the only two named values seems odd though? Most other tests in test/CodeGen/RISCV use a/b/... for arguments and %0/%1/%2/... in the body.

This revision is now accepted and ready to land.Apr 30 2020, 3:32 AM
In D78907#2012344, @asb wrote:

LGTM. Minor nit: using %0 and %2 as the only two named values seems odd though? Most other tests in test/CodeGen/RISCV use a/b/... for arguments and %0/%1/%2/... in the body.

I generated the testcases in Clang (actually using godbolt, but it's doing the same IR lowering as clang HEAD is), which is why the arguments don't have names. I can re-introduce them if that's easier.

asb added a comment.Apr 30 2020, 4:36 AM
In D78907#2012344, @asb wrote:

LGTM. Minor nit: using %0 and %2 as the only two named values seems odd though? Most other tests in test/CodeGen/RISCV use a/b/... for arguments and %0/%1/%2/... in the body.

I generated the testcases in Clang (actually using godbolt, but it's doing the same IR lowering as clang HEAD is), which is why the arguments don't have names. I can re-introduce them if that's easier.

It's not the biggest deal in the world, but the following would better match conventions elsewhere in the dir (whether those conventions are sensible or not is another discussion of course!):

define zeroext i1 @float_not_nan(float %a) nounwind {
  %1 = fcmp ord float %a, 0.000000e+00
  ret i1 %1
}
lenary retitled this revision from [RISCV] Add tests for checking isnan patterns to [RISCV][NFC] Add tests for checking isnan patterns.Apr 30 2020, 5:19 AM
lenary updated this revision to Diff 261194.Apr 30 2020, 5:22 AM

Address feedback on test contents.

luismarques accepted this revision.May 1 2020, 3:17 PM

LGTM. I would prefer a hardfloat ABI to make the test slightly cleaner.

lenary updated this revision to Diff 261641.May 2 2020, 6:47 AM

Update tests to use hard float ABIs

This revision was automatically updated to reflect the committed changes.