This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Add patterns for v4i16/v4f16 -> v4i16/v4f16 bitcasts
ClosedPublic

Authored by pendingchaos on Nov 29 2018, 8:50 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

pendingchaos created this revision.Nov 29 2018, 8:50 AM

This fixes a selection error I came across:

LLVM ERROR: Cannot select: t16: v4f16 = bitcast t15

t15: v4i16,ch = CopyFromReg t0, Register:v4i16 %3
  t14: v4i16 = Register %3

I'm not too familiar with LLVM, so I'm not 100% certain of the correctness or
completeness of this.

I don't have commit access.

Needs test case, but this is correct

Adds a test for the bug.

arsenm added inline comments.Dec 2 2018, 9:28 AM
test/CodeGen/AMDGPU/bitcast-v4f16-v4i16.ll
4 ↗(On Diff #176282)

probably should use amdgpu_ps to avoid the waterfall

9 ↗(On Diff #176282)

Can you add the inverse too?

Update test.

arsenm accepted this revision.Dec 16 2018, 9:39 PM

LGTM

This revision is now accepted and ready to land.Dec 16 2018, 9:39 PM
This revision was automatically updated to reflect the committed changes.