This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][SelectionDAG] Enable TargetLowering::hasBitTest for masks that fit in ANDI.
ClosedPublic

Authored by craig.topper on Mar 24 2022, 9:53 PM.

Details

Summary

Modified DAGCombiner to pass the shift the bittest input and the shift amount
to hasBitTest. This matches the other call to hasBitTest in TargetLowering.h

This is an alternative to D122454.

Diff Detail

Event Timeline

craig.topper created this revision.Mar 24 2022, 9:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 9:53 PM
craig.topper requested review of this revision.Mar 24 2022, 9:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 24 2022, 9:53 PM
lebedev.ri resigned from this revision.Mar 25 2022, 4:12 AM

I neither use nor work on this arch.

Seems fine to me. If I'm seeing it correctly, we wouldn't expect any x86 or Hexagon changes because they don't check for a bit range, just any scalar type.

Seems fine to me. If I'm seeing it correctly, we wouldn't expect any x86 or Hexagon changes because they don't check for a bit range, just any scalar type.

Correct. I'm not sure if I ran the X86/Hexagon tests before I posted or not. I might have just ran it on RISCV. I'll make sure I do that and maybe add more tests.

Move tests to new bittest.ll. Add tests of more bit positions.

craig.topper retitled this revision from [RISCV][WIP] Enable TargetLowering::hasBitTest for masks that fit in ANDI. to [RISCV] Enable TargetLowering::hasBitTest for masks that fit in ANDI..Mar 27 2022, 11:24 PM
craig.topper edited the summary of this revision. (Show Details)
craig.topper retitled this revision from [RISCV] Enable TargetLowering::hasBitTest for masks that fit in ANDI. to [RISCV][SelectionDAG] Enable TargetLowering::hasBitTest for masks that fit in ANDI..
craig.topper edited reviewers, added: asb, luismarques; removed: lebedev.ri.
This revision is now accepted and ready to land.Mar 28 2022, 11:02 AM
This revision was landed with ongoing or failed builds.Mar 28 2022, 12:47 PM
This revision was automatically updated to reflect the committed changes.