[go-nuts] [gollvm] Question related to RewriteStatepointsForGC pass

2021-07-19 Thread Kavindu Gimhan Zoysa
Hi all, After running RewriteStatepointsForGC pass in llvm (using opt-11 --rewrite-statepoints-for-gc), we can see live pointers are added to the go.statepoint intrinsic as shown https://llvm.org/docs/Statepoints.html#rewritestatepointsforgc. But for the below example, if I run the command

Re: [go-nuts] Understanding gollvm garbage collection

2021-07-12 Thread Kavindu Gimhan Zoysa
: > >Also does gollvm create a new stack map? I think it does not use the > stack map created by LLVM. > > gollvm does not use stack maps of the format used by LLVM, correct. > > Than > > > On Fri, Jul 9, 2021 at 11:17 AM Kavindu Gimhan Zoysa > wrote: > >>

Re: [go-nuts] Understanding gollvm garbage collection

2021-07-09 Thread Kavindu Gimhan Zoysa
Also does gollvm create a new stack map? I think it does not use the stack map <https://releases.llvm.org/11.0.1/docs/StackMaps.html#stackmap-format> created by LLVM. Thank you, Kavindu On Friday, 9 July 2021 at 19:35:03 UTC+5:30 Kavindu Gimhan Zoysa wrote: > Thank you Than, Is go

Re: [go-nuts] Understanding gollvm garbage collection

2021-07-09 Thread Kavindu Gimhan Zoysa
d the source code for this GC). > > The GC is located in the Go runtime, the version incorporated into libgo > in gofrontend. See > > > https://go.googlesource.com/gofrontend/+/01cb2b5e69a2d08ef3cc1ea023c22ed9b79f5114/libgo/go/runtime/mgc.go > > Cheers, Than > > On

[go-nuts] Understanding gollvm garbage collection

2021-07-09 Thread Kavindu Gimhan Zoysa
Hi all, By looking at the source code, and other mail theads in group, I was able to understand the sopport of GC by gollvm upto some extend. 1. If we do not enable the gc (-enable-gc=1), GC assumes all the stack memory blocks are pointed to the heap. 2. If gc is enabled, it inserts

Re: [go-nuts] Reason to use different address space in gollvm

2021-07-09 Thread Kavindu Gimhan Zoysa
ample: > > # Dump LLVM IR before a pass > $ ./bin/llvm-goc -O2 -c -emit-llvm -S -enable-gc=1 -mllvm > -print-before=remove-addrspacecast test.go 1> before.dump.txt 2>&1 > > # Dump LLVM IR after a pass > $ ./bin/llvm-goc -O2 -c -emit-llvm -S -enable-gc=1 -mllvm

Re: [go-nuts] Reason to use different address space in gollvm

2021-07-05 Thread Kavindu Gimhan Zoysa
: > See https://llvm.org/docs/Statepoints.html for more on this. > > Thanks, Than > > > On Mon, Jun 28, 2021 at 5:40 AM Kavindu Gimhan Zoysa > wrote: > >> Hi all, >> >> Can you please explain the reason to use different address space when GC

Re: [go-nuts] Re: Reason to add a pass to remote address space

2021-07-02 Thread Kavindu Gimhan Zoysa
Thank you, I will check that. On Friday, 2 July 2021 at 22:18:41 UTC+5:30 th...@google.com wrote: > The commit message for https://go-review.googlesource.com/c/152001 > describes the motivation for this pass. > > Thanks, Than > > > On Fri, Jul 2, 2021 at 4:51 AM

[go-nuts] Re: Reason to add a pass to remote address space

2021-07-02 Thread Kavindu Gimhan Zoysa
Hi all, The subject of the above mail should be corrected as " *Reason to add a pass to remove address space"* Thank you, Kavindu On Friday, 2 July 2021 at 12:36:26 UTC+5:30 Kavindu Gimhan Zoysa wrote: > Hi all, > > Can you please let me know the reason to add a pass to remov

[go-nuts] Reason to add a pass to remote address space

2021-07-02 Thread Kavindu Gimhan Zoysa
Hi all, Can you please let me know the reason to add a pass to remove address spaces as shown below? https://go.googlesource.com/gollvm/+/refs/heads/master/passes/RemoveAddrSpace.cpp#30 As per the comment in CompileGo.cpp, this is done right before the lowering to Machine IR. Thank you,

Re: [go-nuts] Hi all,

2021-06-29 Thread Kavindu Gimhan Zoysa
t; >> I sent a CL to fix this, please stay tuned. >> https://go-review.googlesource.com/c/gollvm/+/331729 >> >> Thanks, Than >> >> >> On Sun, Jun 27, 2021 at 12:22 AM Kavindu Gimhan Zoysa >> wrote: >> >>> Hi, >>> >>>

Re: [go-nuts] How to verify whether gollvm is picked

2021-06-29 Thread Kavindu Gimhan Zoysa
* It has picked gollvm properly. Thank you all On Tuesday, 29 June 2021 at 18:32:22 UTC+5:30 Kavindu Gimhan Zoysa wrote: > Is that okay if I change `/usr/bin/clang-10` to `/usr/bin/clang-11`? > Because I have installed clang-11. > > Thank you, > Kavindu > On Tuesday, 29 June 2021 at

Re: [go-nuts] How to verify whether gollvm is picked

2021-06-29 Thread Kavindu Gimhan Zoysa
../llvm-project/llvm > > Then you should be prepending /tmp/myinstall/bin to your path. > > Thanks, Than > > On Sun, Jun 27, 2021 at 2:59 AM Kavindu Gimhan Zoysa > wrote: > >> Hi all, >> >> I have ran the commands in https://go.googlesource.com/gollvm/#install

Re: [go-nuts] How to verify whether gollvm is picked

2021-06-28 Thread Kavindu Gimhan Zoysa
Thank you. In `go version` command I cannot see `gccgo` or `gollvm` But in `go build -x` command has mentioned that, `llvm-goc` is running located at `/usr/local/bin`. On Monday, 28 June 2021 at 02:53:53 UTC+5:30 Ian Lance Taylor wrote: > On Sat, Jun 26, 2021 at 11:59 PM Kavindu Gimhan Zo

[go-nuts] Reason to use different address space in gollvm

2021-06-28 Thread Kavindu Gimhan Zoysa
Hi all, Can you please explain the reason to use different address space when GC is enabled as shown in the below line? https://go.googlesource.com/gollvm/+/refs/heads/master/driver/CompileGo.cpp#559 Thank you, Kavindu -- You received this message because you are subscribed to the Google

[go-nuts] How to verify whether gollvm is picked

2021-06-27 Thread Kavindu Gimhan Zoysa
Hi all, I have ran the commands in https://go.googlesource.com/gollvm/#installing, (I did not run `ninja install-gollvm`). Then I set the path of bin folder to my $PATH using `export PATH=build-debug/bin:$PATH`. Finally, I was able to run `go build/run test.go` successfully. But my problem

Re: [go-nuts] Hi all,

2021-06-26 Thread Kavindu Gimhan Zoysa
2021 at 23:25:20 UTC+5:30 Kavindu Gimhan Zoysa wrote: > Thank you. Do not I need to check out for a special commit? Can I build > the gollvm by checking out the latest commits in all dependant > repositories(llvm-project, libbacktrace, libgo etc)? > > Thank you, > Kavindu >

Re: [go-nuts] Re: Error when running llvm-goc

2021-06-26 Thread Kavindu Gimhan Zoysa
ild area? > > You might also try this: in your LLVM build area, run "ninja > llvm-symbolizer" and then set > > export LLVM_SYMBOLIZER=${HERE}/bin/llvm-symbolizer > > then rerun the failing "llvm-goc" invocation, that might give you a better > s

Re: [go-nuts] Re: Error when running llvm-goc

2021-06-24 Thread Kavindu Gimhan Zoysa
anything? Thank you, Kavindu On Friday, 25 June 2021 at 00:01:41 UTC+5:30 th...@google.com wrote: > Could you please post the complete "go build" command? > > Thanks, Than > > On Thu, Jun 24, 2021 at 2:05 PM Kavindu Gimhan Zoysa > wrote: > >> Hi all, &g

[go-nuts] Re: Error when running llvm-goc

2021-06-24 Thread Kavindu Gimhan Zoysa
Hi all, Still, I was unable to figure out the reason for the above error. Really appreciate your help. Thank you, Kavindu On Thursday, 24 June 2021 at 12:06:32 UTC+5:30 Kavindu Gimhan Zoysa wrote: > Hi all, > > I have build the gollvm and now I am trying to run it. So I run

Re: [go-nuts] Hi all,

2021-06-24 Thread Kavindu Gimhan Zoysa
esource.com/c/gollvm/+/330609. I'll let you know >> when it is submitted. >> >> Thanks, Than >> >> >> On Wed, Jun 23, 2021 at 5:30 PM Than McIntosh wrote: >> >>> Hi, >>> >>> I'll take a look -- stay tuned. >>> &g

Re: [go-nuts] Hi all,

2021-06-24 Thread Kavindu Gimhan Zoysa
, Jun 23, 2021 at 5:30 PM Than McIntosh wrote: > >> Hi, >> >> I'll take a look -- stay tuned. >> >> Than >> >> >> On Wed, Jun 23, 2021 at 3:04 PM Kavindu Gimhan Zoysa >> wrote: >> >>> By following `gollvm` document I started

[go-nuts] Error when running llvm-goc

2021-06-24 Thread Kavindu Gimhan Zoysa
Hi all, I have build the gollvm and now I am trying to run it. So I run follwing command against a simple go source code. I am getting below error. Really appreciate your input to solve this issue. command : *./bin/llvm-goc test.go* error: *llvm-goc:

Re: [go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kavindu Gimhan Zoysa
r it might be done by a syscall to grow the stack > returning an error. So my question is, why are you asking how infinite > recursion is handled? > > On Wed, Jun 23, 2021 at 7:33 PM Kavindu Gimhan Zoysa > wrote: > >> Hi all, >> >> *package main* >> >> *

[go-nuts] How does stack overflow handles in gollvm

2021-06-23 Thread Kavindu Gimhan Zoysa
Hi all, *package main* *func main() {* * foo()* *}* *func foo() {* * a := 5* * _ = a* * foo()* *}* I have generated the below llvm ir using the command `./bin/llvm-goc -S test.go -dump-ir`. I expected there are some llvm intrinsics that have been used to handle stack overflow. But it is not

[go-nuts] Hi all,

2021-06-23 Thread Kavindu Gimhan Zoysa
By following `gollvm` document I started to build it. But I got this error in the middle of the build process. */home/kavindu/GIT/llvm-project/llvm/tools/gollvm/passes/GC.cpp:20:10: fatal error: llvm/CodeGen/GCStrategy.h: No such file or directory* * 20 | #include