[llvm] Correctly set pointer bit for aggregate values in SelectionDAGBuilder to fix CCIfPtr (PR #70554)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 30 01:16:19 PDT 2023


arsenm wrote:

> Also, in TargetLoweringBase I found one case where an ArgFlags struct is built for output arguments. Here `setPointer` is never used:
> 
> https://github.com/llvm/llvm-project/blob/497b2ebb9edcfd5315586b796f47589e9820b4b9/llvm/lib/CodeGen/TargetLoweringBase.cpp#L1711-L1758
> 
> I am not sure whether this is intentional, or an omission. I could add it if desired, but I was not sure when this function is used, exactly.

The isPointer field is a relatively new hack, most places probably were never updated to set it without a motivating example. It should be consistently respected. Ideally we would move all of this code to use LLT to ease the GlobalISel transition which would directly preserve the pointeriness.

This version looks like it's mostly for FastISel. PPC seems to be using it for tail call eligibility checks, and AArch64 seems to use it to set one field in MachineFunctionInfo (which I think it could avoid)

https://github.com/llvm/llvm-project/pull/70554


More information about the llvm-commits mailing list