[PATCH] D133340: [PowerPC][GISel]select floating point constant from TOC

ChenZheng via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 4 23:30:09 PST 2023


shchenz added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/GISel/PPCLegalizerInfo.cpp:53
 
+  getActionDefinitionsBuilder(G_FCONSTANT).lowerFor({S32, S64});
+  getActionDefinitionsBuilder(G_CONSTANT_POOL).legalFor({P0});
----------------
arsenm wrote:
> nemanjai wrote:
> > In SDAG, we have the capability to mark specific FP constants legal. Does a similar capability exist with GISel? Not using constant pool loads for constants such as `0.0` is quite important.
> > Perhaps a TODO is in order here?
> It's not implemented. You could custom lower it, or use the immediate legal hook in the default lower implementation
Yes, GISel has the ability to mark specific FP constants legal/custom/lower at same opcode in the legalizerinfo classs.


================
Comment at: llvm/test/CodeGen/PowerPC/GlobalISel/fconstant-unsupported.ll:1
+; REQUIRES: asserts
+
----------------
nemanjai wrote:
> arsenm wrote:
> > This doesn't require asserts
> Hmm, is it that producing FP constants using GISel is not supported or that GISel is not supported at all for BE and 32-bit? I imagine it is the latter.
Yes, GISel is not supported at all for BE for now. GISel supports 32 bit, but PPC does not support 32 bit GISel for now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D133340



More information about the llvm-commits mailing list