Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-12 Thread Balamurugan M
Hi!

Ohh! Yes please, that'll be very helpful for our experiments.
Thank you so much.

Regards

On Mon, Apr 11, 2022, 2:50 PM Than McIntosh  wrote:

> Hello,
>
> At the moment gollvm doesn't support anything like the "-Xclang -load
> -Xclang ...".
>
> It would not be too hard to add this though. Want to send a patch?
>
> Thanks, Than
>
>
> On Sun, Apr 10, 2022 at 3:47 PM Balamurugan Marimuthu 
> wrote:
>
>> Yes, something like that! I basically want to run my custom pass as I
>> compile using 'go build'
>>
>>  But looks like llvm-goc doesn't support the -Xclang option
>>
>>
>>
>>
>> *$ go build -gccgoflags="-Xclang -load -Xclang
>> ../passes/FunctionInsertPass.so" cache_main.go#
>> command-line-arguments/gollvm/install/bin/llvm-goc: error: unrecognized
>> command line option '-Xclang'/gollvm/install/bin/llvm-goc: error:
>> unrecognized command line option '-Xclang'*
>>
>> Is there a way to load my custom pass as part of 'go build'?
>>
>> Thanks!
>>
>> On Sunday, April 10, 2022 at 12:14:34 AM UTC-4 Ian Lance Taylor wrote:
>>
>>> On Sat, Apr 9, 2022 at 8:28 PM Balamurugan Marimuthu
>>>  wrote:
>>> >
>>> > I see I can invoke the following and see the steps 'go build' is
>>> doing.
>>> >
>>> > % go build -work -x mypackage.go 1> transcript.txt 2>&1
>>> >
>>> > I struggle to understand how can I load my custom pass created as a
>>> shared library?
>>> >
>>> > I was looking for something like this which is done with Clang:
>>> > clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.*
>>> something.c
>>> >
>>> > Is my understanding correct? Any help/pointers will be really helpful.
>>>
>>> Perhaps you are looking for something like
>>>
>>> go build -gccgoflags="-Xclang -load -Xclang
>>> build/skeleton/libSkeletonPass.*"
>>>
>>> Ian
>>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/9a976aca-4c5d-4074-a19d-f843e8b5ca63n%40googlegroups.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABFwZMqVy-0GiV1Qa9%2BNqAYs-fU1tW_1f79VgvkMwkHfnEiPQA%40mail.gmail.com.


Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-12 Thread 'Than McIntosh' via golang-nuts
It would not be too hard to add this though. Want to send a patch?

>>Ohh! Yes please, that'll be very helpful for our experiments.
>>Thank you so much.

I think you misunderstood my comment. I was asking if you would like to
send a patch yourself.

Thanks, Than



On Mon, Apr 11, 2022 at 10:02 PM Balamurugan M  wrote:

> Hi!
>
> Ohh! Yes please, that'll be very helpful for our experiments.
> Thank you so much.
>
> Regards
>
> On Mon, Apr 11, 2022, 2:50 PM Than McIntosh  wrote:
>
>> Hello,
>>
>> At the moment gollvm doesn't support anything like the "-Xclang -load
>> -Xclang ...".
>>
>> It would not be too hard to add this though. Want to send a patch?
>>
>> Thanks, Than
>>
>>
>> On Sun, Apr 10, 2022 at 3:47 PM Balamurugan Marimuthu <
>> balamu...@gmail.com> wrote:
>>
>>> Yes, something like that! I basically want to run my custom pass as I
>>> compile using 'go build'
>>>
>>>  But looks like llvm-goc doesn't support the -Xclang option
>>>
>>>
>>>
>>>
>>> *$ go build -gccgoflags="-Xclang -load -Xclang
>>> ../passes/FunctionInsertPass.so" cache_main.go#
>>> command-line-arguments/gollvm/install/bin/llvm-goc: error: unrecognized
>>> command line option '-Xclang'/gollvm/install/bin/llvm-goc: error:
>>> unrecognized command line option '-Xclang'*
>>>
>>> Is there a way to load my custom pass as part of 'go build'?
>>>
>>> Thanks!
>>>
>>> On Sunday, April 10, 2022 at 12:14:34 AM UTC-4 Ian Lance Taylor wrote:
>>>
 On Sat, Apr 9, 2022 at 8:28 PM Balamurugan Marimuthu
  wrote:
 >
 > I see I can invoke the following and see the steps 'go build' is
 doing.
 >
 > % go build -work -x mypackage.go 1> transcript.txt 2>&1
 >
 > I struggle to understand how can I load my custom pass created as a
 shared library?
 >
 > I was looking for something like this which is done with Clang:
 > clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.*
 something.c
 >
 > Is my understanding correct? Any help/pointers will be really
 helpful.

 Perhaps you are looking for something like

 go build -gccgoflags="-Xclang -load -Xclang
 build/skeleton/libSkeletonPass.*"

 Ian

>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/9a976aca-4c5d-4074-a19d-f843e8b5ca63n%40googlegroups.com
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55Gj_fqqKFM9CMSz%3DPS8V7gGrAfriaJBxVGtD-9jVThatA%40mail.gmail.com.


Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-11 Thread 'Than McIntosh' via golang-nuts
Hello,

At the moment gollvm doesn't support anything like the "-Xclang -load
-Xclang ...".

It would not be too hard to add this though. Want to send a patch?

Thanks, Than


On Sun, Apr 10, 2022 at 3:47 PM Balamurugan Marimuthu 
wrote:

> Yes, something like that! I basically want to run my custom pass as I
> compile using 'go build'
>
>  But looks like llvm-goc doesn't support the -Xclang option
>
>
>
>
> *$ go build -gccgoflags="-Xclang -load -Xclang
> ../passes/FunctionInsertPass.so" cache_main.go#
> command-line-arguments/gollvm/install/bin/llvm-goc: error: unrecognized
> command line option '-Xclang'/gollvm/install/bin/llvm-goc: error:
> unrecognized command line option '-Xclang'*
>
> Is there a way to load my custom pass as part of 'go build'?
>
> Thanks!
>
> On Sunday, April 10, 2022 at 12:14:34 AM UTC-4 Ian Lance Taylor wrote:
>
>> On Sat, Apr 9, 2022 at 8:28 PM Balamurugan Marimuthu
>>  wrote:
>> >
>> > I see I can invoke the following and see the steps 'go build' is doing.
>> >
>> > % go build -work -x mypackage.go 1> transcript.txt 2>&1
>> >
>> > I struggle to understand how can I load my custom pass created as a
>> shared library?
>> >
>> > I was looking for something like this which is done with Clang:
>> > clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.*
>> something.c
>> >
>> > Is my understanding correct? Any help/pointers will be really helpful.
>>
>> Perhaps you are looking for something like
>>
>> go build -gccgoflags="-Xclang -load -Xclang
>> build/skeleton/libSkeletonPass.*"
>>
>> Ian
>>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/9a976aca-4c5d-4074-a19d-f843e8b5ca63n%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2BUr55FHKv3K0rm1S-58Om06_54aj4ZKS8G-nBkgKHVMh6ozrQ%40mail.gmail.com.


Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-10 Thread Balamurugan Marimuthu
Yes, something like that! I basically want to run my custom pass as I 
compile using 'go build'

 But looks like llvm-goc doesn't support the -Xclang option




*$ go build -gccgoflags="-Xclang -load -Xclang 
../passes/FunctionInsertPass.so" cache_main.go# 
command-line-arguments/gollvm/install/bin/llvm-goc: error: unrecognized 
command line option '-Xclang'/gollvm/install/bin/llvm-goc: error: 
unrecognized command line option '-Xclang'*

Is there a way to load my custom pass as part of 'go build'?

Thanks!

On Sunday, April 10, 2022 at 12:14:34 AM UTC-4 Ian Lance Taylor wrote:

> On Sat, Apr 9, 2022 at 8:28 PM Balamurugan Marimuthu
>  wrote:
> >
> > I see I can invoke the following and see the steps 'go build' is doing.
> >
> > % go build -work -x mypackage.go 1> transcript.txt 2>&1
> >
> > I struggle to understand how can I load my custom pass created as a 
> shared library?
> >
> > I was looking for something like this which is done with Clang:
> > clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.* something.c
> >
> > Is my understanding correct? Any help/pointers will be really helpful.
>
> Perhaps you are looking for something like
>
> go build -gccgoflags="-Xclang -load -Xclang
> build/skeleton/libSkeletonPass.*"
>
> Ian
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/9a976aca-4c5d-4074-a19d-f843e8b5ca63n%40googlegroups.com.


Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-09 Thread Ian Lance Taylor
On Sat, Apr 9, 2022 at 8:28 PM Balamurugan Marimuthu
 wrote:
>
> I see I can invoke the following and see the steps 'go build' is doing.
>
> % go build -work -x mypackage.go 1> transcript.txt 2>&1
>
> I struggle to understand how can I load my custom pass created as a shared 
> library?
>
> I was looking for something like this which is done with Clang:
> clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.* something.c
>
> Is my understanding correct? Any help/pointers will be really helpful.

Perhaps you are looking for something like

go build -gccgoflags="-Xclang -load -Xclang
build/skeleton/libSkeletonPass.*"

Ian

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcWC-cJfEa%3D9vR6kdqCFZ4xCC2fcoo-Q0_UJjZ_O%2BCYbVQ%40mail.gmail.com.


[go-nuts] Dynamically loading custom passes with gollvm?

2022-04-09 Thread Balamurugan Marimuthu
Hi there,

I see I can invoke the following and see the steps 'go build' is doing.

% go build -work -x mypackage.go 1> transcript.txt 2>&1

I struggle to understand how can I load my custom pass created as a shared 
library?

I was looking for something like this which is done with Clang:
clang -Xclang -load -Xclang build/skeleton/libSkeletonPass.* something.c

Is my understanding correct? Any help/pointers will be really helpful. 
Thanks! 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/407c2bc8-3af8-4128-8472-d87fe31e6c72n%40googlegroups.com.