This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Promote uniform i16 bitreverse intrinsic to i32
ClosedPublic

Authored by kzhuravl on Sep 30 2016, 12:59 PM.

Diff Detail

Event Timeline

kzhuravl updated this revision to Diff 73121.Sep 30 2016, 12:59 PM
kzhuravl retitled this revision from to [AMDGPU] Promote uniform i16 bitreverse intrinsic to i32.
kzhuravl updated this object.
kzhuravl added reviewers: tstellarAMD, arsenm.
kzhuravl added a subscriber: llvm-commits.
arsenm added inline comments.Oct 2 2016, 8:54 PM
lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
286

This should be able to handle any bitwidth < 32. We will want this for the < i16 types that will want to be legalized to i16 as well

293–296

You should just define these when declared instead of resetting them below

424–425

This should be a switch since other intrinsics are likely, and it can just return the result of visitBitreverseIntrinsicInst directly

test/CodeGen/AMDGPU/amdgpu-codegenprepare-i16-to-i32.ll
509

Should have a test with smaller bitwidth

510–515

There should be check lines for the non-VI case for the unprompted case

kzhuravl updated this revision to Diff 73236.Oct 2 2016, 11:21 PM
kzhuravl edited edge metadata.
kzhuravl marked 3 inline comments as done.

Address review feedback

kzhuravl added inline comments.Oct 2 2016, 11:21 PM
lib/Target/AMDGPU/AMDGPUCodeGenPrepare.cpp
286

I am working on handling smaller types in instructions and bitereverse in a separate patch, it is almost ready (I need to clean up and update doxygen). smaller types patch fixes a bunch of test failures on Wei's fp16 branch.

test/CodeGen/AMDGPU/amdgpu-codegenprepare-i16-to-i32.ll
509

In a separate patch.

kzhuravl updated this revision to Diff 73675.Oct 5 2016, 11:05 AM
kzhuravl edited edge metadata.

Bring up to date with trunk.

arsenm accepted this revision.Oct 5 2016, 6:53 PM
arsenm edited edge metadata.

LGTM

This revision is now accepted and ready to land.Oct 5 2016, 6:53 PM
kzhuravl closed this revision.Oct 5 2016, 9:37 PM

r283415