Unigine Valley regression since radeon/llvm: Run LLVM's instruction combining pass
https://bugs.freedesktop.org/show_bug.cgi?id=90056
Bug ID: 90056
Summary: Unigine Valley regression since radeon/llvm: Run
LLVM's instruction combining pass
Product: Mesa
Version: git
Hardware: Other
OS: All
Status: NEW
Severity: normal
Priority: medium
Component: Drivers/Gallium/radeonsi
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
R9270X
Since
commit c6d79ed289a75f13c65f011be870f7e43a0fedc7
Author: Tom Stellard <[email protected]> Date: Fri Apr 10 17:07:16 2015 +0000
radeon/llvm: Run LLVM's instruction combining pass
This should improve code quality in general and will help with some future changes to how we emit kill instructions.
shader-db shows a few regressions, but these don't seem to be the result of deficiencies in instcombine. They're mostly caused by the scheduler making different decisions than before.
Unigine Valley quits saying -
Unhandled loop condition!
UNREACHABLE executed at SIAnnotateControlFlow.cpp:267!
Only tried my normal settings on valley which are
quality ultra + 8x AA
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #1 from Tom Stellard <[email protected]> ---
Could you run the program with the environment variable R600_DEBUG=ps,vs,gs and post the output.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #2 from Andy Furniss <[email protected]> --- Created attachment 115136
--> https://bugs.freedesktop.org/attachment.cgi?id=115136&action=edit
valley with R600_DEBUG=ps,vs,gs
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #3 from Grigori Goronzy <[email protected]> --- Control flow annotation seems to choke on a predecessor with "undef" incoming value, for some reason.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #4 from Grigori Goronzy <[email protected]> --- Created attachment 115333
--> https://bugs.freedesktop.org/attachment.cgi?id=115333&action=edit
Reduced test case
Here's a reduced testcase. I'm not sure how undef branch conditions are supposed to be handled, make someone else can take a look?
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #5 from Michel Dänzer <[email protected]> ---
If this can't be fixed soon, maybe the bisected change should be reverted for now?
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #6 from Grigori Goronzy <[email protected]> --- Created attachment 115401
--> https://bugs.freedesktop.org/attachment.cgi?id=115401&action=edit
Possible fix
How about this? Not tested yet, I don't have access to a radeon GPU right now.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #7 from Andy Furniss <[email protected]> --- (In reply to Grigori Goronzy from comment #6)
Quoted 5 lines
Created attachment 115401 [details] [review]
Possible fixHow about this? Not tested yet, I don't have access to a radeon GPU right now.
It doesn't help valley.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #8 from Tom Stellard <[email protected]> --- Does this patch help:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20150202/257738.html
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #9 from Grigori Goronzy <[email protected]> --- Created attachment 115409
--> https://bugs.freedesktop.org/attachment.cgi?id=115409&action=edit
Full shader
That does not help either. Seems to break the SSA somehow. Full shader that triggers the bug attached.
The patch I posted earlier help with the the reduced testcase, but not with the full shader. Both undef incoming values in phi nodes and undef branch conditions cause problems in different ways.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #10 from Andy Furniss <[email protected]> --- (In reply to Grigori Goronzy from comment #9)
Quoted 9 lines
Created attachment 115409 [details] [review]
Full shaderThat does not help either. Seems to break the SSA somehow. Full shader that triggers the bug attached.
The patch I posted earlier help with the the reduced testcase, but not with the full shader. Both undef incoming values in phi nodes and undef branch conditions cause problems in different ways.
With the second patch + valley I get -
valley_x64: LiveVariables.cpp:114: void llvm::LiveVariables::MarkVirtRegAliveInBlock(llvm::LiveVariables::VarInfo &, llvm::MachineBasicBlock *, llvm::MachineBasicBlock *, std::vector<MachineBasicBlock *> &): Assertion `MBB != &MF->front() && "Can't find reaching def for virtreg"' failed.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #11 from Tom Stellard <[email protected]> --- Created attachment 115423
--> https://bugs.freedesktop.org/attachment.cgi?id=115423&action=edit
Reduced test case
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #12 from Tom Stellard <[email protected]> --- (In reply to Andy Furniss from comment #10)
Quoted 11 lines
(In reply to Grigori Goronzy from comment #9)
Quoted 9 lines
Created attachment 115409 [details] [review] [review] Full shader
That does not help either. Seems to break the SSA somehow. Full shader that triggers the bug attached.
The patch I posted earlier help with the the reduced testcase, but not with the full shader. Both undef incoming values in phi nodes and undef branch conditions cause problems in different ways.
Quoted 7 lines
With the second patch + valley I get -
valley_x64: LiveVariables.cpp:114: void llvm::LiveVariables::MarkVirtRegAliveInBlock(llvm::LiveVariables::VarInfo &,llvm::MachineBasicBlock*,llvm::MachineBasicBlock*, std::vector<MachineBasicBlock *> &): Assertion `MBB !=&MF->front()&& "Can't find reaching def for virtreg"' failed.
Did test with only the patch from comment #8 or did you test with both patches?
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #13 from Andy Furniss <[email protected]> --- (In reply to Tom Stellard from comment #12)
Quoted 14 lines
(In reply to Andy Furniss from comment #10)
Quoted 13 lines
(In reply to Grigori Goronzy from comment #9)
Quoted 9 lines
Created attachment 115409 [details] [review] [review] [review] Full shader
That does not help either. Seems to break the SSA somehow. Full shader that triggers the bug attached.
The patch I posted earlier help with the the reduced testcase, but not with the full shader. Both undef incoming values in phi nodes and undef branch conditions cause problems in different ways.
With the second patch + valley I get -
Quoted 8 lines
Quoted 5 lines
valley_x64: LiveVariables.cpp:114: void llvm::LiveVariables::MarkVirtRegAliveInBlock(llvm::LiveVariables::VarInfo &,llvm::MachineBasicBlock*,llvm::MachineBasicBlock*, std::vector<MachineBasicBlock *> &): Assertion `MBB !=&MF->front()&& "Can't find reaching def for virtreg"' failed.Did test with only the patch from comment #8 or did you test with both patches?
Just #8 but I just tried with both and get the same fail.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
Tom Stellard <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #115423|0 |1
is obsolete| |
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #14 from Tom Stellard <[email protected]> --- Created attachment 115488
--> https://bugs.freedesktop.org/attachment.cgi?id=115488&action=edit
Possible fix
Can you try this applying this patch only?
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #15 from Andy Furniss <[email protected]> --- (In reply to Tom Stellard from comment #14)
Quoted 4 lines
Created attachment 115488 [details] [review]
Possible fixCan you try this applying this patch only?
This fixes it.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
Tom Stellard <[email protected]> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution|--- |FIXED--- Comment #16 from Tom Stellard <[email protected]> --- Fixed in llvm: r236306
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #17 from [email protected] ---
Since mesa 10.6 is going RC soon, what's going to happen with this feature? If it remains enabled, and the fix isn't backported to llvm 3.6, this bug will end up being present in a stable release (unless llvm 3.7 is also going to be released soon).
Fez is also affected by the same bug (I tested and verified that it is fixed by the same patch), so there may be many more games affected:
Good (mesa 10.5): https://www.dropbox.com/s/h7qtlgln1xlnxrk/fez_good.png?dl=0
Bad (mesa 10.6): https://www.dropbox.com/s/f5yqqx2l6pz284z/fez_bad.png?dl=0
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
https://bugs.freedesktop.org/show_bug.cgi?id=90056
--- Comment #18 from Tom Stellard <[email protected]> --- (In reply to Furkan from comment #17)
Quoted 10 lines
Since mesa 10.6 is going RC soon, what's going to happen with this feature? If it remains enabled, and the fix isn't backported to llvm 3.6, this bug will end up being present in a stable release (unless llvm 3.7 is also going to be released soon).
Fez is also affected by the same bug (I tested and verified that it is fixed by the same patch), so there may be many more games affected:
Good (mesa 10.5): https://www.dropbox.com/s/h7qtlgln1xlnxrk/fez_good.png?dl=0
Bad (mesa 10.6): https://www.dropbox.com/s/f5yqqx2l6pz284z/fez_bad.png?dl=0
This bug will be fixed in the LLVM 3.6.1 release.
Signature · 2 lines
You are receiving this mail because: You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel