This is an archive of the discontinued LLVM Phabricator instance.

[X86][BITREVERSE] Optimized bitreverse builtin for 8 bit scalar integer (PR31810)
AbandonedPublic

Authored by kbelochapka on Jul 18 2017, 7:13 PM.

Details

Summary

manually optimized code for 8 bit integer bit reverse builtin, instruction count reduced from 14 to 11, slight performance gain

Diff Detail

Event Timeline

kbelochapka created this revision.Jul 18 2017, 7:13 PM
kbelochapka retitled this revision from [X86][BITREVERSE] Optimized bitreverse builtin for 8 bit scalar integer to [X86][BITREVERSE] Optimized bitreverse builtin for 8 bit scalar integer (PR31810).Jul 18 2017, 7:17 PM
kbelochapka edited the summary of this revision. (Show Details)
kbelochapka added a reviewer: craig.topper.
RKSimon edited edge metadata.Jul 19 2017, 3:01 AM

The performance implications on PR31810 need to be settled before this can be taken any further

lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
2613

This is general legalization code - we should ensure that ISD::ROTL is legalorcustom before attempting this path, otherwise the additional shift/mask code will definitely be a regression. With that in place you can probably drop the VT.isScalarInteger() requirement.

test/CodeGen/X86/bitreverse.ll
338

Please use the update_llc_test_checks.py script

kbelochapka abandoned this revision.Sep 15 2017, 2:54 PM

The performance measurement testing did not show any performance benefit for the proposed 8bit bit reversal intrinsic implementation over the existing one.