[llvm-dev] A Question on stackmap locations of a record

Kavindu Gimhan Zoysa via llvm-dev llvm-dev at lists.llvm.org
Thu Sep 23 12:17:32 PDT 2021


Yes, I also think I have misunderstood.
In this documentation[1], it is mentioned that "*Each record consists of a
pair of Locations.*". That is why I assumed there must be 4 locations for
gc-live operands(there are 2 gc-live operands). Please consider below two
cases.
1. "*gc-live"(i8 addrspace(1)* %5)*
2. "*gc-live"(i8 addrspace(1)* %35, i8 addrspace(1)* %34)*
I have copied the relevant stack map section for the above cases. For case
1, we can find two locations and for case 2 we can find 4 locations. This
result is matched with the above statement of documentation[1].
But for my initial example, there are only two locations. I am a bit
confused about this result.
Where did I misunderstand?

*case 1:*
 .quad 2882400000
.long .Ltmp1-_B_foo
.short 0
.short 5
.byte 4
.byte 0
.short 8
.short 0
.short 0
.long 0
.byte 4
.byte 0
.short 8
.short 0
.short 0
.long 0
.byte 4
.byte 0
.short 8
.short 0
.short 0
.long 0
// 2 locations
.byte 3
.byte 0
.short 8
.short 7
.short 0
.long 0
.byte 3
.byte 0
.short 8
.short 7
.short 0
.long 0

*case 2:*
 .quad 2882400000
.long .Ltmp5-_B_foo
.short 0
.short 7
.byte 4
.byte 0
.short 8
.short 0
.short 0
.long 0
.byte 4
.byte 0
.short 8
.short 0
.short 0
.long 0
.byte 4
.byte 0
.short 8
.short 0
.short 0
.long 0
// 4 locations
.byte 3
.byte 0
.short 8
.short 7
.short 0
.long 8
.byte 3
.byte 0
.short 8
.short 7
.short 0
.long 8
.byte 3
.byte 0
.short 8
.short 7
.short 0
.long 0
.byte 3
.byte 0
.short 8
.short 7
.short 0
.long 0

[1]: https://llvm.org/docs/Statepoints.html#stack-map-format

Kavindu Gimhan Zoysa,
BSc(Hons) | ENTC | UoM,
ATL | WSO2

GitHub <https://github.com/KavinduZoysa> LinkedIn
<https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/> Medium
<https://medium.com/@kavindugimhanzoysa>


On Tue, 21 Sept 2021 at 01:20, Philip Reames <listmail at philipreames.com>
wrote:

> The lowering described appears to match the expected behavior of the
> statepoint you've described.  It's not clear why you believe there should
> be four values in the lowering when that is not what you've specified in
> the IR.  You'll need to provide a bit more context if you want help.  My
> best guess is that you've misunderstood the documentation - maybe you've
> confused the stackmap format with the behavior of RS4GC?
>
> Philip
> On 9/18/21 11:57 AM, Kavindu Gimhan Zoysa via llvm-dev wrote:
>
> Hi all,
>
> *[ "gc-live"(<2 x i8 addrspace(1)*> %68, <2 x i8 addrspace(1)*> %base_ie)
> ]*
>
> Please consider that I have an LLVM IR which has a statepoint with the
> above gc-live operands.
> The generated stackmap record for the above statepoint has below
> properties.
>
> 1. only 2 locations
> 2. both are indirect
> 3. size of each location is 16 bytes
> 4. offsets are different. i.e. 0x30 and 0x20
>
> As I understand, in stackmap we can see pair of locations always
> for a single pointer. But in this case, there should be 4 locations because
> we have 2 pointers in the statepoint.
>
> Can you help me to solve this?
>
> Thank you,
> Kavindu
>
> Kavindu Gimhan Zoysa,
> BSc(Hons) | ENTC | UoM,
> ATL | WSO2
>
> GitHub <https://github.com/KavinduZoysa> LinkedIn
> <https://www.linkedin.com/in/kavindu-gimhan-zoysa-85939a122/> Medium
> <https://medium.com/@kavindugimhanzoysa>
>
> _______________________________________________
> LLVM Developers mailing listllvm-dev at lists.llvm.orghttps://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210924/158d1d38/attachment.html>


More information about the llvm-dev mailing list