This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly] Fix up out-of-range BUILD_VECTOR lane constants
ClosedPublic

Authored by tlively on Aug 24 2021, 3:44 PM.

Details

Summary

Fixes PR51605 in which a DAG combine and legalization sequence generated
out-of-range constants in BUILD_VECTOR lanes. In the v16i8 case, the constants
were 255, which would be in range if DAG ISel used unsigned constants, but it is
out of range because DAG ISel uses signed constants.

Diff Detail

Event Timeline

tlively created this revision.Aug 24 2021, 3:44 PM
tlively requested review of this revision.Aug 24 2021, 3:44 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 24 2021, 3:44 PM
dschuff added inline comments.Aug 24 2021, 4:14 PM
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
2055

as we discussed offline, maybe we could turn the first half of this expression into an assert.
It might be nice if we could give names to any other of these subexpressions, but I don't know what any of them would be...

tlively updated this revision to Diff 368499.Aug 24 2021, 5:07 PM
  • Fix lane VT
dschuff accepted this revision.Aug 24 2021, 5:19 PM
dschuff added inline comments.
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
2055

Extra condition looks good. It might still be a good idea to do the assert though.

This revision is now accepted and ready to land.Aug 24 2021, 5:19 PM
tlively updated this revision to Diff 368505.Aug 24 2021, 5:21 PM
  • Expand comment.
  • Assert that the value is not too negative.
This revision was landed with ongoing or failed builds.Aug 24 2021, 5:24 PM
This revision was automatically updated to reflect the committed changes.