This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Remove saturating fp-to-int target intrinsics
ClosedPublic

Authored by tlively on Apr 15 2021, 1:38 PM.

Details

Summary

Use the target-independent @llvm.fptosi and @llvm.fptoui intrinsics instead.
This includes removing the instrinsics for i32x4.trunc_sat_zero_f64x2_{s,u},
which are now represented in IR as a saturating truncation to a v2i32 followed by
a concatenation with a zero vector.

Diff Detail

Event Timeline

tlively created this revision.Apr 15 2021, 1:38 PM
tlively requested review of this revision.Apr 15 2021, 1:38 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 15 2021, 1:38 PM
aheejin accepted this revision.Apr 16 2021, 12:39 AM
aheejin added inline comments.
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
124–127

So far these have been expanded then?

2100

So even though you used Builder.CreateShuffleVector in Clang, do they appear as not VECTOR_SHUFFLE but CONCAT_VECTORS by the time they reach isel?

2130

Nit: I think it is a little easier to read

This revision is now accepted and ready to land.Apr 16 2021, 12:39 AM
tlively added inline comments.Apr 16 2021, 12:01 PM
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
124–127

That's right 👍

2100

Right. LLVM IR has no concat_vectors instruction, but the pattern is recognized by SelectionDAGBuilder and turned into a concat_vectors SDNode.

2130

Will fix.

This revision was landed with ongoing or failed builds.Apr 16 2021, 12:11 PM
This revision was automatically updated to reflect the committed changes.
llvm/test/CodeGen/WebAssembly/simd-intrinsics.ll