Bug 80037 - i965: Figure out how to remove copy-propagated MOV x, (abs)x
Summary: i965: Figure out how to remove copy-propagated MOV x, (abs)x
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Ian Romanick
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: i965-perf
  Show dependency treegraph
 
Reported: 2014-06-14 21:28 UTC by Matt Turner
Modified: 2015-02-11 23:25 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Matt Turner 2014-06-14 21:28:22 UTC
Some psychonauts shaders do pow(abs(x), y), which generates

mov vgrf10:F, |vgrf10|:F
pow vgrf53:F, vgrf10:F, vgrf55:F

We copy propagate from the MOV into the POW:

mov vgrf10:F, |vgrf10|:F
pow vgrf53:F, |vgrf10|:F, vgrf55:F

but since vgrf10 is used after the MOV, dead code elimination isn't able to recognize that it's no longer used and so we can't remove it.

We could probably handle this in copy-propagation. After copy-propagating a MOV x, (abs)x instruction we'd check if its value has been propagated into all uses of the MOV's destination, and if so remove the MOV.
Comment 1 Iago Toral 2014-09-11 10:09:44 UTC
(In reply to comment #0)
> Some psychonauts shaders do pow(abs(x), y), which generates
> 
> mov vgrf10:F, |vgrf10|:F
> pow vgrf53:F, vgrf10:F, vgrf55:F
> 
> We copy propagate from the MOV into the POW:
> 
> mov vgrf10:F, |vgrf10|:F
> pow vgrf53:F, |vgrf10|:F, vgrf55:F

This is not happening for me. What I get is something like this:

mov(8)          g11<1>F         (abs)g7<4,4,1>.xF
math pow(8)     g13<1>F         g11<8,8,1>F     g12<8,8,1>F


This was on SNB... is abs copy propagation only happening for specific hardware generations?
Comment 2 Matt Turner 2014-09-11 15:45:59 UTC
Yes, since SNB can't do source modifiers on math instructions.
Comment 3 Matt Turner 2015-02-11 23:25:48 UTC
I think the register renaming pass has solved this.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.