This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] More convert_low and promote_low codegen
ClosedPublic

Authored by tlively on Aug 18 2021, 4:32 PM.

Details

Summary

The convert_low and promote_low instructions can widen the lower two lanes of a
four-lane vector, but we were previously scalarizing patterns that widened lanes
besides the low two lanes. The commit adds a shuffle to move the widened lanes
into the low lane positions so the convert_low and promote_low instructions can
be used instead of scalarizing.

Depends on D108266.

Diff Detail

Event Timeline

tlively created this revision.Aug 18 2021, 4:32 PM
tlively requested review of this revision.Aug 18 2021, 4:32 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 18 2021, 4:32 PM
dschuff accepted this revision.Aug 19 2021, 2:18 PM
This revision is now accepted and ready to land.Aug 19 2021, 2:18 PM
This revision was landed with ongoing or failed builds.Aug 19 2021, 3:37 PM
This revision was automatically updated to reflect the committed changes.

I'm seeing narrowing diagnostic failures from this:

llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1840:33: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
                               {LHSIndex, RHSIndex + 4, -1, -1});
                                ^~~~~~~~
llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1840:33: note: insert an explicit cast to silence this issue
                               {LHSIndex, RHSIndex + 4, -1, -1});
                                ^~~~~~~~
                                static_cast<int>( )
llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1840:43: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing]
                               {LHSIndex, RHSIndex + 4, -1, -1});
                                          ^~~~~~~~~~~~
llvm-project/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp:1840:43: note: insert an explicit cast to silence this issue
                               {LHSIndex, RHSIndex + 4, -1, -1});
                                          ^~~~~~~~~~~~
                                          static_cast<int>( )

Could you please look into a fix?

Yes, sorry about that. I'll fix that momentarily.