This is an archive of the discontinued LLVM Phabricator instance.

[GlobalISel][Legalizer] Implement lower action for G_FSHL/G_FSHR
AbandonedPublic

Authored by kschwarz on Oct 15 2020, 9:13 AM.

Details

Reviewers
arsenm
foad
Summary

This is a 1:1 port from the SelectionDAG code, modulo the recent optimizations for known non-zero shift amounts.
Additionally, no conversion between G_FSHL <-> G_FSHR are done yet.

Diff Detail

Event Timeline

kschwarz created this revision.Oct 15 2020, 9:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 15 2020, 9:13 AM
kschwarz requested review of this revision.Oct 15 2020, 9:13 AM
foad added inline comments.Oct 15 2020, 9:22 AM
llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
6246–6247

Doesn't this lowering work for vectors?

6252

Is DstTy guaranteed to be the same type as the shift amount operand?

6254–6255

Can't you just use auto ShAmt = MIRBuilder.buildWhatever(...) to avoid explicitly calling createGenericVirtualRegister here and below?

6255–6256

Do we have something that will combine this UREM into an AND if BW is a power of two?

kschwarz abandoned this revision.Oct 15 2020, 11:34 AM

Duplicate D76500

I somehow forgot about this open review. I'll abandon this then.
Is there anything we can help with to get D76500 integrated? Since a recent upstream change we are seeing G_FSHL's being generated, which our GISel-only backend cannot handle.

Duplicate D76500

I somehow forgot about this open review. I'll abandon this then.
Is there anything we can help with to get D76500 integrated? Since a recent upstream change we are seeing G_FSHL's being generated, which our GISel-only backend cannot handle.

The main thing holding that up is I haven't had time to address the problem of avoiding expanding the division in the divide-by-constant case