This is an archive of the discontinued LLVM Phabricator instance.

DAG: Handle inversion of fcSubnormal | fcZero
ClosedPublic

Authored by arsenm on Feb 2 2023, 8:22 AM.

Details

Summary

There are a number of more test combinations here that
can be done together and reduce the number of instructions.

Diff Detail

Event Timeline

arsenm created this revision.Feb 2 2023, 8:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 8:22 AM
arsenm requested review of this revision.Feb 2 2023, 8:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 2 2023, 8:22 AM
Herald added a subscriber: wdng. · View Herald Transcript
sepavloff added inline comments.Feb 6 2023, 10:13 AM
llvm/include/llvm/CodeGen/CodeGenCommonISel.h
225–226

Doxygen comments must be on separate lines.

llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
7333 ↗(On Diff #494320)

This variable seems unused. It is possible to remove it?

llvm/test/CodeGen/X86/is_fpclass.ll
866–868

This code looks incorrect. The argument is compared against 0.0 and the result is true if the comparison is unordered or not equal.

arsenm updated this revision to Diff 495215.Feb 6 2023, 10:46 AM
arsenm marked 2 inline comments as done.

Fix inverted case

llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
7333 ↗(On Diff #494320)

Yes but I was trying to document changes that need to be made to match the DAG version

llvm/test/CodeGen/X86/is_fpclass.ll
866–868

Looks like I broke the inverted case and ended up fixing it in one of my later patches

sepavloff added inline comments.Feb 22 2023, 8:55 AM
llvm/test/CodeGen/X86/is_fpclass.ll
866–868

Not sure if x87 has DAZ mode. Corresponding flag is in MXCSR only and it is not clear if MXCSR affects operations in x87. @jcranmer-intel, could you please clarify this point?

arsenm added inline comments.Feb 22 2023, 10:06 AM
llvm/test/CodeGen/X86/is_fpclass.ll
866–868

The attribute says codegen can assume this. If the hardware doesn't actually support the mode this is just undefined usage which doesn't matter

sepavloff added inline comments.Feb 27 2023, 2:27 AM
llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
8113

Why ISD::SETONE? If condition is "ordered and equal", then inversion of it is "unordered or not equal", isn't it?

arsenm updated this revision to Diff 528211.Jun 4 2023, 5:57 AM

Undo opcode change

llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
8113

I don't really remember what I was thinking here

sepavloff accepted this revision.Jun 6 2023, 10:39 AM

LGTM.

llvm/lib/CodeGen/CodeGenCommonISel.cpp
177
This revision is now accepted and ready to land.Jun 6 2023, 10:39 AM