[PATCH] D91050: [NFC] Add the EmitTargetCodeForConstantPool hook for target to customize it with MachineConstantPoolValue

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 30 12:36:14 PDT 2021


efriedma added a comment.

In D91050#2915306 <https://reviews.llvm.org/D91050#2915306>, @steven.zhang wrote:

> In D91050#2905380 <https://reviews.llvm.org/D91050#2905380>, @efriedma wrote:
>
>> Passing an alignment in and returning an alignment out at the same time seems unlikely to be useful.  DAGCombine can refine the alignment later anyway, if it turns out to be relevant. Maybe rename the version that returns the alignment out?
>
> Passing a constant in,which has the alignment of the constant,return a constantpool,which need to specify the alignment of constantpool. We cannot query the alignment of constantpool now as the result could be cp + offset.

I think you're missing my point.  If the caller has a particular idea of what alignment it needs, it will request it.  The result will have at least that alignment.  If the actual alignment comes out higher, it doesn't really matter.

SelectionDAG::computeKnownBits can be used to query the alignment of an arbitrary pointer.  It looks like it doesn't currently try to use the alignment of a constant pool, but it could, if it mattered.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91050



More information about the llvm-commits mailing list