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

Qing Shan Zhang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 2 01:49:13 PDT 2021


steven.zhang added a comment.

In D91050#2917401 <https://reviews.llvm.org/D91050#2917401>, @efriedma wrote:

> 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.

Great to know that we have some way to query the alignment. If that works, we could have one patch to avoid querying the constant pool alignment again after it is created. And get the underlying alignment with computeKnowBits likewise interface in the place that need the exactly alignment.


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