This is an archive of the discontinued LLVM Phabricator instance.

RBIT Instruction only available for ARMv6t2 and above.
ClosedPublic

Authored by zzheng on Jan 6 2016, 11:34 AM.

Details

Summary

r255334 matches bit-reverse pattern in InstCombine and generates calls to Instrinsic::bitreverse.

RBIT instruction is only available for ARMv6t2 and above. This patch has the intrinsic expanded during legalization for ARMv4 and ARMv5.

Patch by Z. Zheng <zhaoshiz@codeaurora.org>

Diff Detail

Repository
rL LLVM

Event Timeline

zzheng updated this revision to Diff 44137.Jan 6 2016, 11:34 AM
zzheng retitled this revision from to RBIT Instruction only available for ARMv6t2 and above..
zzheng updated this object.
zzheng added reviewers: jmolloy, apazos.
zzheng set the repository for this revision to rL LLVM.
zzheng added a subscriber: llvm-commits.
jmolloy edited edge metadata.Jan 7 2016, 12:43 AM

Hi,

Why isn't the right solution to adapt this check in ISelLowering:

if (!Subtarget->isThumb1Only())
  setOperationAction(ISD::BITREVERSE, MVT::i32, Legal);

?

Cheers,

James

zzheng updated this revision to Diff 44300.Jan 7 2016, 6:00 PM
zzheng updated this object.
zzheng edited edge metadata.

Thanks James. Totally missed legalization part. Please review the new patch.

jmolloy accepted this revision.Jan 8 2016, 12:49 AM
jmolloy edited edge metadata.

This now LGTM. Thanks!

This revision is now accepted and ready to land.Jan 8 2016, 12:49 AM
zzheng updated this object.Jan 8 2016, 10:44 AM
zzheng added a reviewer: weimingz.
weimingz closed this revision.Jan 8 2016, 10:47 AM