This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Use generic bitreverse intrinsic
ClosedPublic

Authored by arsenm on Nov 30 2015, 1:54 PM.

Details

Summary

Also fix bug in vector legalization for bitreverse.

Diff Detail

Event Timeline

arsenm updated this revision to Diff 41432.Nov 30 2015, 1:54 PM
arsenm retitled this revision from to AMDGPU: Use generic bitreverse intrinsic.
arsenm updated this object.
arsenm added reviewers: tstellarAMD, jmolloy.
arsenm added a subscriber: llvm-commits.
tstellarAMD added inline comments.Dec 1 2015, 8:27 AM
lib/Target/AMDGPU/AMDGPUISelLowering.cpp
1039–1041

We have to keep this intrinsic, because we are using it in Mesa.

tstellarAMD requested changes to this revision.Dec 1 2015, 9:00 AM
tstellarAMD edited edge metadata.
This revision now requires changes to proceed.Dec 1 2015, 9:00 AM
arsenm updated this revision to Diff 41541.Dec 1 2015, 11:25 AM
arsenm edited edge metadata.

Add compatibility with old intrinsic name

tstellarAMD accepted this revision.Dec 1 2015, 1:33 PM
tstellarAMD edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Dec 1 2015, 1:33 PM
arsenm added a comment.Dec 1 2015, 3:13 PM

Actually the AArch64 bitreverse test is broken from the legalization fix. It looks like it now gets scalarized and then fully expanded instead of the expansion with vector ops.

arsenm updated this revision to Diff 42590.Dec 11 2015, 2:58 PM
arsenm edited edge metadata.

Fix ARM test failures. If the required vector bit instruction are available, defer legalization to LegalizeDAG.

jmolloy edited edge metadata.Dec 14 2015, 8:33 AM

At Matt's request I looked at this; it looks fine to me. I'm glad the AArch64 bitreverse test correctly caught the poor expansion!

arsenm closed this revision.Dec 14 2015, 9:28 AM

r255512

test/CodeGen/AMDGPU/bitreverse.ll