Re: [Mesa-dev] i965: overwriting parts of a register and optimization passes

2014-07-10 Thread Iago Toral

Hi Kenneth,

El 2014-07-09 17:19, Kenneth Graunke escribió:

On Tuesday, July 08, 2014 11:19:38 AM Iago Toral wrote:


Hi,







I have some code that first initializes a register and then

overwrites a


specific subregister. However, after the optimization passes in



brw_vec4.cpp the initialization instruction goes away. I see that

live


intervals are computed for the destination register without

considering


if we are writing only to a specific subregister, so I guess that is

the


reason for this behaviour, but this strikes me as odd, as it defeats

the


purpose of overwriting only specific subregs, so I guess there is



something else that I am missing.







This an example of what is happening:







mov(8) g61.xUD g04,4,1UD {



align16 WE_all 1Q };



mov(1) g6.21UD 0x0007UD { align1



WE_all compacted };







The first MOV is removed from the instruction set when I put the

second


MOV, however the second MOV should only be writing to subreg 6.2 and




keep the rest of register 6 intact, or at least that is what I am

trying


to do...







Can someone explain what is wrong with those two instructions? how



should I overwrite only a specific subregister without causing this



behavior?







Thanks,



Iago


This sounds a lot like the bug I fixed in:

commit d0575d98fc595dcc17706dc73d1eb461027ca17a

Author: Kenneth Graunke kenn...@whitecape.org

Date: Sat Jun 14 03:53:07 2014 -0700

 i965/vec4: Fix dead code elimination for VGRFs of size  1.

where it would see those two as the same register, and delete the
first MOV.

You probably already have that in your tree though, right? If not,
update :)


Yeah, I have it already, so I guess my problem was different.


If so, you might try turning off other optimization passes in
brw_vec4.cpp and see if it helps - sounds like a bug in one of them.


The one causing that behaviour was the dead code elimination pass in 
brw_vec4.cpp. Anyway, this is not happening consistently, I have done 
some changes to my code that are unrelated to these two instructions and 
now this is not happening any more...


Iago
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] i965: overwriting parts of a register and optimization passes

2014-07-09 Thread Kenneth Graunke
On Tuesday, July 08, 2014 11:19:38 AM Iago Toral wrote:
 Hi,

 I have some code that first initializes a register and then overwrites a
 specific subregister. However, after the optimization passes in
 brw_vec4.cpp the initialization instruction goes away. I see that live
 intervals are computed for the destination register without considering
 if we are writing only to a specific subregister, so I guess that is the
 reason for this behaviour, but this strikes me as odd, as it defeats the
 purpose of overwriting only specific subregs, so I guess there is
 something else that I am missing.

 This an example of what is happening:

 mov(8)  g61.xUD   g04,4,1UD {
 align16 WE_all 1Q };
 mov(1)  g6.21UD   0x0007UD{ align1
   WE_all compacted };

 The first MOV is removed from the instruction set when I put the second
 MOV, however the second MOV should only be writing to subreg 6.2 and
 keep the rest of register 6 intact, or at least that is what I am trying
 to do...

 Can someone explain what is wrong with those two instructions? how
 should I overwrite only a specific subregister without causing this
 behavior?

 Thanks,
 Iago

This sounds a lot like the bug I fixed in:

commit d0575d98fc595dcc17706dc73d1eb461027ca17a
Author: Kenneth Graunke kenn...@whitecape.org
Date:   Sat Jun 14 03:53:07 2014 -0700

i965/vec4: Fix dead code elimination for VGRFs of size  1.

where it would see those two as the same register, and delete the first MOV.

You probably already have that in your tree though, right?  If not, update :)
If so, you might try turning off other optimization passes in brw_vec4.cpp and
see if it helps - sounds like a bug in one of them.

--Ken

signature.asc
Description: This is a digitally signed message part.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] i965: overwriting parts of a register and optimization passes

2014-07-09 Thread Kristian Høgsberg
On Wed, Jul 9, 2014 at 8:19 AM, Kenneth Graunke kenn...@whitecape.org wrote:
 On Tuesday, July 08, 2014 11:19:38 AM Iago Toral wrote:

 Hi,



 I have some code that first initializes a register and then overwrites a

 specific subregister. However, after the optimization passes in

 brw_vec4.cpp the initialization instruction goes away. I see that live

 intervals are computed for the destination register without considering

 if we are writing only to a specific subregister, so I guess that is the

 reason for this behaviour, but this strikes me as odd, as it defeats the

 purpose of overwriting only specific subregs, so I guess there is

 something else that I am missing.



 This an example of what is happening:



 mov(8) g61.xUD g04,4,1UD {

 align16 WE_all 1Q };

 mov(1) g6.21UD 0x0007UD { align1

 WE_all compacted };



 The first MOV is removed from the instruction set when I put the second

 MOV, however the second MOV should only be writing to subreg 6.2 and

 keep the rest of register 6 intact, or at least that is what I am trying

 to do...



 Can someone explain what is wrong with those two instructions? how

 should I overwrite only a specific subregister without causing this

 behavior?



 Thanks,

 Iago



 This sounds a lot like the bug I fixed in:



 commit d0575d98fc595dcc17706dc73d1eb461027ca17a

 Author: Kenneth Graunke kenn...@whitecape.org

 Date: Sat Jun 14 03:53:07 2014 -0700



 i965/vec4: Fix dead code elimination for VGRFs of size  1.



 where it would see those two as the same register, and delete the first MOV.



 You probably already have that in your tree though, right? If not, update :)

 If so, you might try turning off other optimization passes in brw_vec4.cpp
 and see if it helps - sounds like a bug in one of them.

Or you could add something like Matts DEBUG_OPTIMIZER from brw_fs.cpp
to also cover brw_vec4.cpp.

Kristian
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] i965: overwriting parts of a register and optimization passes

2014-07-08 Thread Iago Toral

Hi,

I have some code that first initializes a register and then overwrites a 
specific subregister. However, after the optimization passes in 
brw_vec4.cpp the initialization instruction goes away. I see that live 
intervals are computed for the destination register without considering 
if we are writing only to a specific subregister, so I guess that is the 
reason for this behaviour, but this strikes me as odd, as it defeats the 
purpose of overwriting only specific subregs, so I guess there is 
something else that I am missing.


This an example of what is happening:

mov(8)  g61.xUD   g04,4,1UD { 
align16 WE_all 1Q };
mov(1)  g6.21UD   0x0007UD{ align1 
 WE_all compacted };


The first MOV is removed from the instruction set when I put the second 
MOV, however the second MOV should only be writing to subreg 6.2 and 
keep the rest of register 6 intact, or at least that is what I am trying 
to do...


Can someone explain what is wrong with those two instructions? how 
should I overwrite only a specific subregister without causing this 
behavior?


Thanks,
Iago
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev