[PATCH] D83948: [PowerPC] Custom lowering for funnel shifts

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 07:16:51 PDT 2020


nemanjai accepted this revision.
nemanjai added a comment.
This revision is now accepted and ready to land.

LGTM.



================
Comment at: llvm/test/CodeGen/PowerPC/pr44183.ll:16-21
+; CHECK-NEXT:    li r3, 4
+; CHECK-NEXT:    ld r4, 16(r30)
+; CHECK-NEXT:    ld r5, 8(r30)
+; CHECK-NEXT:    subfic r29, r3, 64
+; CHECK-NEXT:    rldicl r3, r5, 60, 4
+; CHECK-NEXT:    sld r4, r4, r29
----------------
spatel wrote:
> foad wrote:
> > This regressions seems to be caused by not constant folding based on the fact that r3 is known to be 4. Can anyone suggest how to fix it? Do I have to spot known constant shift amounts in PPCTargetLowering::LowerFunnelShift?
> This is an unusual test because it contains "i216" types, but that's apparently the way the code was written in:
> http://bugs.llvm.org/PR44183
> 
> Maybe because of that, the constants are marked opaque from DAG creation time:
> Creating constant: t6: i216 = OpaqueConstant<4>
> ...so default constant folding is bypassed. Someone with more PPC knowledge probably needs to decide what -- if anything -- needs to be done here. 
I agree with Sanjay, this is due to the weird size. However, it is not a concern. I'll post a very small tweak to our Reg+Reg -> Reg+Imm transformation that recovers this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83948/new/

https://reviews.llvm.org/D83948





More information about the llvm-commits mailing list