-
Notifications
You must be signed in to change notification settings - Fork 12.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[X86][LegalizeDAG] FPOWI: promote f16 operand #105775
[X86][LegalizeDAG] FPOWI: promote f16 operand #105775
Conversation
@llvm/pr-subscribers-backend-x86 Author: None (v01dXYZ) ChangesFixes #105747 Full diff: https://github.com/llvm/llvm-project/pull/105775.diff 1 Files Affected:
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index e0face6b6a7904..83bb2577777864 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -614,6 +614,7 @@ X86TargetLowering::X86TargetLowering(const X86TargetMachine &TM,
setOperationAction(ISD::FTAN, VT, Action);
setOperationAction(ISD::FSQRT, VT, Action);
setOperationAction(ISD::FPOW, VT, Action);
+ setOperationAction(ISD::FPOWI, VT, Action);
setOperationAction(ISD::FLOG, VT, Action);
setOperationAction(ISD::FLOG2, VT, Action);
setOperationAction(ISD::FLOG10, VT, Action);
|
Add a test case for it? |
@phoebewang Hi, I hesitate between putting this test in I'll put it in |
|
I discovered something strange with BTW the reason I'm looking into that is because that's another Opcode with a default value set to |
There is something I don't understand in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a test case (probably to avx512fp16-scalar.ll ?)
…tion We can add additional tests in the future, but this is an initial placeholder Inspired by #105775
I've added fp16-libcalls.ll which should give us better test coverage - please add the powi tests there |
…tion We can add additional tests in the future, but this is an initial placeholder Inspired by llvm#105775
…tion We can add additional tests in the future, but this is an initial placeholder Inspired by #105775
374c8d8
to
80246e0
Compare
I was worried than another Opcode presented the same problem (ie with LegalizeAction defaulting to Expand and spawning an assert when LegalizeDAG fallthroughs to libcall convertion). But it seems FPOWI is special, that's the only float Opcode in I have a vocabulary question: in the strict terminology of Legalisation, expand means breaking up a complex operation using smaller types, should I rather think of it as an Instruction Expand ? |
80246e0
to
1710821
Compare
Just need to add powi test with #105775
It depends on what legalization stage you're dealing with - expand to legal type / scalarize / split into simpler instructions etc. I've added more tests to fp16-libcalls.ll - please can you rebase? |
Instead of defaulting to Expand. Warning: The added test case fails with asserts enabled.
Instead of defaulting to Expand. Without that, since Expand is not implemented for FPOWI, it fallthroughs to Libcall. As there are no f16 libcalls, the program aborts when asserts are enabled.
1710821
to
56673ee
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just need to add powi test with llvm#105775
Fixes llvm#105747 --------- Co-authored-by: v01dxyz <[email protected]>
…tion We can add additional tests in the future, but this is an initial placeholder Inspired by llvm#105775
Fixes #105747