This is an archive of the discontinued LLVM Phabricator instance.

[AArch64] Fix useful bits detection for BFM instructions
ClosedPublic

Authored by sbaranga on Nov 25 2016, 6:52 AM.

Details

Summary

When computing useful bits for a BFM instruction, we need
to take into consideration the case where both operands
of the BFM are equal and provide data that we need to track.

Not doing this can cause us to miss useful bits.

Fixes PR31138 (https://llvm.org/bugs/show_bug.cgi?id=31138)

Event Timeline

sbaranga updated this revision to Diff 79301.Nov 25 2016, 6:52 AM
sbaranga retitled this revision from to [AArch64] Fix useful bits detection for BFM instructions.
sbaranga updated this object.
sbaranga added reviewers: t.p.northover, jmolloy.
sbaranga added a subscriber: llvm-commits.
gberry added a subscriber: gberry.Nov 28 2016, 10:13 AM

This is looking great. We already verified that the patch resolves the original bug that was reported.

test/CodeGen/AArch64/arm64-bitfield-extract.ll
544

Should all these values be renamed to something more clear? For example, this is probably better as %shr47. Several other long value names below could similarly be improved.

sbaranga updated this revision to Diff 79568.Nov 29 2016, 7:20 AM

Update variable names names in the test and make it more readable overall.

Thanks for cleaning up the names in the test. I would prefer someone more familiar with this backend to approve it, but everything looks great now.

jmolloy accepted this revision.Nov 30 2016, 8:50 AM
jmolloy edited edge metadata.

LGTM too. Thanks!

This revision is now accepted and ready to land.Nov 30 2016, 8:50 AM
sbaranga closed this revision.Nov 30 2016, 9:14 AM

Thanks, both! r288253

-Silviu