[PATCH] D95458: [PowerPC] Exploit xxsplti32dx (constant materialization) for scalars

Albion Fung via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 24 00:10:32 PST 2021


Conanap added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.h:1321
   bool convertToNonDenormSingle(APFloat &ArgAPFloat);
+  bool checkNonDenormCannotConvertToSingle(APInt &ArgAPInt);
+  bool checkNonDenormCannotConvertToSingle(APFloat &ArgAPFloat);
----------------
stefanp wrote:
> Is the APInt version of this function used anywere?
> 
Hm I don't think so, although I implemented it for consistency with `XXSPLTIDP` (`convertToNonDenormSingle`). I'll remove this if that is preferred.


================
Comment at: llvm/test/CodeGen/PowerPC/constant-pool.ll:363
+; CHECK-NEXT:    stxv vs3, 32(r1) # 16-byte Folded Spill
+; CHECK-NEXT:    xxsplti32dx vs3, 1, -343597384
+; CHECK-NEXT:    # kill: def $f3 killed $f3 killed $vsl3
----------------
stefanp wrote:
> What is going on here?
> It almost looks like we are spilling `vs3` half way through materializing a constant.
This is fixed now, thank you for spotting this.


================
Comment at: llvm/test/CodeGen/PowerPC/pcrel-linkeropt.ll:147
 ; CHECK-NEXT:  .Lpcrel5:
-; CHECK-NEXT:    plfd f1, .LCPI6_0 at PCREL(0), 1
+; CHECK-NEXT:    xxsplti32dx vs1, 0, 1075524403
+; CHECK-NEXT:    xxsplti32dx vs1, 1, 858993459
----------------
Just a heads up - the tests in this file are autogenerated, hence some unrelated changes.


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

https://reviews.llvm.org/D95458



More information about the llvm-commits mailing list