This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Fix for vector element insertion
ClosedPublic

Authored by timcorringham on Feb 1 2019, 7:05 AM.

Details

Summary

Incorrect code was generated when lowering insertelement operations
for vectors with 8 or 16 bit elements. The value being inserted was
not adjusted for the position of the element within the 32 bit word
and so only the low element within each 32 bit word could receive
the intended value.

Fixed by simply replicating the value to each element of a
congruent vector before the mask and or operation used to
update the intended element.

A number of affected LIT tests have been updated appropriately.

before the mask & or into the intended

Diff Detail

Repository
rL LLVM

Event Timeline

timcorringham created this revision.Feb 1 2019, 7:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2019, 7:05 AM
arsenm accepted this revision.Feb 1 2019, 7:19 AM

LGTM with a more descriptive comment

lib/Target/AMDGPU/SIISelLowering.cpp
4374 ↗(On Diff #184747)

Can you elaborate more in this comment?

This revision is now accepted and ready to land.Feb 1 2019, 7:19 AM
This revision was automatically updated to reflect the committed changes.