Problem in interpreting LLVM Stack Map

Hi all,

Let’s say I have placed statepoints as follows.

define @foo() {
%1 = call malloc(4)

}
define @bar() {
%1 = call malloc(4)
%token = call @llvm…statepoint.p0f_isVoidf(…foo(), … i8* %2)
%afterRelo = call @llvm.gc.relocate(token %token, i32 7, i32 7)

}
define @main() {
%1 = call malloc(4)
%token = call @llvm…statepoint.p0f_isVoidf(…bar(), … i8* %2)
}

If I check the LLVM StackMap, for the bar function, locations look like this,

Kind : 4
Flags : 0
Location Size : 8
Reg Num : 0
Reserved : 0
Offset : 0

Kind : 4
Flags : 0
Location Size : 8
Reg Num : 0
Reserved : 0
Offset : 0

Kind : 4
Flags : 0
Location Size : 8
Reg Num : 0
Reserved : 0
Offset : 0

Kind : 3
Flags : 0
Location Size : 8
Reg Num : 7
Reserved : 0
Offset : 0

Kind : 3
Flags : 0
Location Size : 8
Reg Num : 7
Reserved : 0
Offset : 0

After reading document 1, I figured out that if the kind is 3, the location of heap reference can be found at BP + Offset. But here the offset is 0. Could you please explain me how to interpret this stack frame, and how do we find the location of a given heap reference in the stack map for a given heap reference?