This is an archive of the discontinued LLVM Phabricator instance.

[X86] Enable STRICT_SINT_TO_FP/STRICT_UINT_TO_FP on X86 backend
ClosedPublic

Authored by pengfei on Dec 25 2019, 12:52 AM.

Details

Event Timeline

pengfei created this revision.Dec 25 2019, 12:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 25 2019, 12:52 AM
craig.topper added inline comments.Dec 25 2019, 1:56 AM
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
568

Is a for loop needed here? Isn’t there only one non chain operand?

571

If the loop is needed I’d use a continue instead of incrementing j. Or handle it outside the loop and start the loop at 1 for strict.

llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
7390 ↗(On Diff #235264)

Do not change this. Normal FP_ROUND has a special case for equal types to skip creating the node. We can’t do that for strict because we can’t manage the chain here. The caller needs to avoid calling getNode when the types are equal.

llvm/lib/Target/X86/X86ISelLowering.cpp
18896

The chain result from this isn’t used. You probably need a token factor somewhere

18897

Use getValue

18905

Use merge values don’t do your own replacement

19008

Can the low bit cast be moved up and shared by both paths?

19011

getValue

19012

Merge values

43804

The chain result isn’t being returned or connected

llvm/test/CodeGen/X86/fp-intrinsics.ll
2204

What change caused these test changes? It looks like most of this patch is vector related. What did I miss?

pengfei updated this revision to Diff 235279.Dec 25 2019, 4:35 AM

Address review comments.

pengfei marked 11 inline comments as done.Dec 25 2019, 4:40 AM
pengfei added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
568

It has no difference between strict and normal node. Removed.

llvm/test/CodeGen/X86/fp-intrinsics.ll
2204

The target combine for the node STRICT_SINT_TO_FP/STRICT_UINT_TO_FP.

pengfei updated this revision to Diff 235281.Dec 25 2019, 4:54 AM

Minor fixup.

This revision is now accepted and ready to land.Dec 25 2019, 10:22 AM
This revision was automatically updated to reflect the committed changes.