Hoisting built-in call out of loop - LIM pass [tree-ssa-loop-im.c]

2022-06-01 Thread Shubham Narlawar via Gcc
Hello, [1] I want to achieve hosting of a custom built-in call out of loop that loads an immediate value. for (int i = 0; i < 4000; i++) { _9 = (unsigned int) _1; slli_6 = _9 << 8; srli_36 = slli_6 >> 8; li_37 = __builtin_load_immediate (15);//I want to

Ferching Rtl instruction corressponding to Gimple Call instruction

2022-04-11 Thread Shubham Narlawar via Gcc
Hello, I want to collect complete rtl instruction corresponding to below gimple call - "__builtin_temp" I have gimple instructions of form - slli_31 = _2 << 8; srli_32 = slli_31 >> 8; add_33 = srli_32 + 15; _20 = __builtin_temp (instrn_buffer.36_1, 1, add_33); For that, I put breakpoint in

Re: Validation of adding left shift stmt at GIMPLE - [Custom GCC plugin]]

2022-03-27 Thread Shubham Narlawar via Gcc
gt; > > > > > > On Sun, Feb 20, 2022 at 10:45 AM Shubham Narlawar > > > > > > wrote: > > > > > > > > > > > > > > On Sat, Feb 19, 2022 at 1:15 AM Andrew Pinski > > > > > > > wr

Re: Validation of adding left shift stmt at GIMPLE - [Custom GCC plugin]]

2022-02-22 Thread Shubham Narlawar via Gcc
> > > wrote: > > > > > > > > On Sun, Feb 20, 2022 at 10:45 AM Shubham Narlawar > > > > wrote: > > > > > > > > > > On Sat, Feb 19, 2022 at 1:15 AM Andrew Pinski > > > > > wrote:

Re: Validation of adding left shift stmt at GIMPLE - [Custom GCC plugin]]

2022-02-21 Thread Shubham Narlawar via Gcc
wrote: > > > > > > > > On Fri, Feb 18, 2022 at 11:04 AM Shubham Narlawar via Gcc > > > > wrote: > > > > > > > > > > Hello, > > > > > > > > > > I want to know whether it is correct to add left

Re: Validation of adding left shift stmt at GIMPLE - [Custom GCC plugin]]

2022-02-20 Thread Shubham Narlawar via Gcc
On Sat, Feb 19, 2022 at 1:15 AM Andrew Pinski wrote: > > On Fri, Feb 18, 2022 at 11:04 AM Shubham Narlawar via Gcc > wrote: > > > > Hello, > > > > I want to know whether it is correct to add left shift instruction to > > a constant expression statement li

Validation of adding left shift stmt at GIMPLE - [Custom GCC plugin]]

2022-02-18 Thread Shubham Narlawar via Gcc
Hello, I want to know whether it is correct to add left shift instruction to a constant expression statement like "_3 + 4"? I am trying to add a left shift instruction in between below GIMPLE instructions - : instrn_buffer.0_1 = instrn_buffer; _2 = tree.cnt; _3 = (int) _2; _4 = _3 +

Query regarding generating NOTE instruction at GIMPLE level

2022-02-06 Thread Shubham Narlawar via Gcc
Hello, Is it possible to generate a NOTE instruction at GIMPLE level? My use case scenario is as below - I want to create a note for __builtin_xyz(_x) such that there is a placeholder just before function call and in RTL pass, I want to modify/assign register number at this placeholder location.

Re: Accessing const parameter of GIMPLE_CALL

2022-01-18 Thread Shubham Narlawar via Gcc
c > > > wrote: > > > > > > > > On Sun, 2022-01-16 at 18:52 +0530, Shubham Narlawar via Gcc wrote: > > > > > Hello, > > > > > > > > Hi; various notes inline below... > > > > > > > > > >

Re: Accessing const parameter of GIMPLE_CALL

2022-01-18 Thread Shubham Narlawar via Gcc
On Tue, Jan 18, 2022 at 2:19 AM Martin Sebor wrote: > > On 1/17/22 12:18, Shubham Narlawar via Gcc wrote: > > On Mon, Jan 17, 2022 at 1:55 PM Richard Biener > > wrote: > >> > >> On Mon, Jan 17, 2022 at 12:54 AM David Malcolm via Gcc > >> wrote:

Re: Accessing const parameter of GIMPLE_CALL

2022-01-17 Thread Shubham Narlawar via Gcc
On Mon, Jan 17, 2022 at 1:55 PM Richard Biener wrote: > > On Mon, Jan 17, 2022 at 12:54 AM David Malcolm via Gcc > wrote: > > > > On Sun, 2022-01-16 at 18:52 +0530, Shubham Narlawar via Gcc wrote: > > > Hello, > > > > Hi; various notes inline below...

Re: Accessing const parameter of GIMPLE_CALL

2022-01-17 Thread Shubham Narlawar via Gcc
On Mon, Jan 17, 2022 at 5:23 AM David Malcolm wrote: > > On Sun, 2022-01-16 at 18:52 +0530, Shubham Narlawar via Gcc wrote: > > Hello, > > Hi; various notes inline below... > > > > > My aim is to iterate over gimple call stmt parameters and check > > whethe

Accessing const parameter of GIMPLE_CALL

2022-01-16 Thread Shubham Narlawar via Gcc
Hello, My aim is to iterate over gimple call stmt parameters and check whether it is constant or constant expression and mark/store them for some gimple transformation. I have an intrinsic function call of the following - __builtin_xyz(void*, 7, addr + 10); I want to find its parameters which

Re: Updating phi nodes on deleting gimple statement

2021-12-17 Thread Shubham Narlawar via Gcc
On Thu, 16 Dec, 2021, 6:28 pm Richard Biener, wrote: > On December 16, 2021 7:33:37 AM GMT+01:00, Shubham Narlawar via Gcc < > gcc@gcc.gnu.org> wrote: > >Hello, > > > > > >I have a PHI node that defines a variable that is used in 1 statement. I > >

Updating phi nodes on deleting gimple statement

2021-12-15 Thread Shubham Narlawar via Gcc
Hello, I have a PHI node that defines a variable that is used in 1 statement. I then delete the statement. I think I need to update the PHI node to no longer reference that variable. I looked through some code and I don't see a way to just remove an element from a PHI node and I see in the file

Re: Extracting function name from the gimple call statement

2021-10-11 Thread Shubham Narlawar via Gcc
On Mon, Oct 11, 2021 at 2:51 AM David Malcolm wrote: > > On Sun, 2021-10-10 at 23:04 +0530, Shubham Narlawar via Gcc wrote: > > Hello, > > > > Is there a direct way to print the name of the function call in gimple > > call > > statement? > > > >

Extracting function name from the gimple call statement

2021-10-10 Thread Shubham Narlawar via Gcc
Hello, Is there a direct way to print the name of the function call in gimple call statement? For example - void bar() { a = foo();//gimple* stmt } I want to print "foo" from the above gimple*. I traced debug_gimple_stmt(gimple*) but it seems complex to just print "foo". Thanks and

Re: Get struct function* from function declaration

2021-02-16 Thread Shubham Narlawar via Gcc
On Tue, 16 Feb, 2021, 5:55 PM Shuai Wang via Gcc, wrote: > Thank you for your reply! > > I tried to use this in the following code: > > tree func_decl = gimple_call_fndecl(stmt); // stmt is the function call > statement > function* f = DECL_STRUCT_FUNCTION(func_decl); > std::cerr <<

Vectorization of loop which operate on local arrays

2020-04-14 Thread Shubham Narlawar via Gcc
Hello, I am working on gcc-4.9.4 and encountered different results of loop vectorization on array arr0, arr1 and arr2. Testcase - int main() { int i; for (i=0; i<64; i++) { arr2[i]=(arr1[i]|arr0[i]); } } Using -O2 -ftree-vectorize, Above loop is vectorized if