Bug 107146 - swr doesn't compile with current LLVM 7.0 snapshots
Summary: swr doesn't compile with current LLVM 7.0 snapshots
Status: RESOLVED MOVED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/swr (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-06 23:09 UTC by Bernhard Rosenkraenzer
Modified: 2019-09-18 18:24 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
proposed patch (4.33 KB, patch)
2018-07-20 11:54 UTC, Philip Meulengracht
Details | Splinter Review

Description Bernhard Rosenkraenzer 2018-07-06 23:09:33 UTC
createInstructionSimplifierPass() has been removed in LLVM. This is used in a few places in SWR; looks like this can safely be removed because it is always preceded by createInstructionCombiningPass() which seems to be a superset of what createInstructionSimplifierPass() used to do.

Fixing this just unmasks another problem though - Intrinsic::x86_fma_vfmadd_ps_256 is gone. Not sure how to replace that properly.
Comment 1 Roland Scheidegger 2018-07-07 19:27:24 UTC
(In reply to Bernhard Rosenkraenzer from comment #0)
> createInstructionSimplifierPass() has been removed in LLVM. This is used in
> a few places in SWR; looks like this can safely be removed because it is
> always preceded by createInstructionCombiningPass() which seems to be a
> superset of what createInstructionSimplifierPass() used to do.
> 
> Fixing this just unmasks another problem though -
> Intrinsic::x86_fma_vfmadd_ps_256 is gone. Not sure how to replace that
> properly.

I believe the caller doesn't actually care if it's fma or fmul/fadd combo. In this case it should just be replaced with llvm.fmuladd - this works will all (supported by swr) llvm versions, and you don't need to distinguish in the caller if the cpu supports fma or not, llvm will automatically emit either fma or fmul/fadd.
Comment 2 Philip Meulengracht 2018-07-20 11:54:02 UTC
Created attachment 140731 [details] [review]
proposed patch

See my attachment for a proposed patch - I encounted this error too and removed the references to the vfmaddps, and I removed the SimplePass's due to them being unnecessary. Please feel free to correct me or the patch if it's wrong. 

Instead of the vfmaddps it will use mul add.
Comment 3 Alok Hota 2018-08-28 15:05:06 UTC
(In reply to Bernhard Rosenkraenzer from comment #0)
> createInstructionSimplifierPass() has been removed in LLVM. This is used in
> a few places in SWR; looks like this can safely be removed because it is
> always preceded by createInstructionCombiningPass() which seems to be a
> superset of what createInstructionSimplifierPass() used to do.
> 
> Fixing this just unmasks another problem though -
> Intrinsic::x86_fma_vfmadd_ps_256 is gone. Not sure how to replace that
> properly.

I can confirm we're seeing this issue as well.

(In reply to Philip Meulengracht from comment #2)
> Created attachment 140731 [details] [review] [review]
> proposed patch
> 
> See my attachment for a proposed patch - I encounted this error too and
> removed the references to the vfmaddps, and I removed the SimplePass's due
> to them being unnecessary. Please feel free to correct me or the patch if
> it's wrong. 
> 
> Instead of the vfmaddps it will use mul add.

Thanks for the patch! I'm looking into this now.
Comment 4 GitLab Migration User 2019-09-18 18:24:24 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/196.


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.