Bug 32564

Summary: [llvmpipe] prog: Unknown command line argument '-disable-mmx'. Try: 'prog -help' with llvm-2.9svn
Product: Mesa Reporter: Vinson Lee <vlee>
Component: OtherAssignee: Brian Paul <brianp>
Status: RESOLVED FIXED QA Contact:
Severity: blocker    
Priority: medium CC: EoD, jfonseca, keithw
Version: 7.10   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Vinson Lee 2010-12-21 17:02:42 UTC
mesa: 4fe78d3e12fa963273de4d83b1fd55a78a5d41bf (master)
llvm: llvm-2.9svn r122379

Run any program with llvmpipe built with llvm-2.9svn. The following error appears.
prog: Unknown command line argument '-disable-mmx'.  Try: 'prog -help'

The error occurs with both 32-bit and 64-bit llvm.

The error does not occur with llvm-2.9svn r121711.

llvm-2.6 - good
llvm-2.7 - good
llvm-2.8 - good
llvm-2.9svn r121711 - good
llvm-2.9svn r122379 - bad
Comment 1 Vinson Lee 2010-12-21 17:13:02 UTC
The error is likely trigger by these llvm commits.

------------------------------------------------------------------------
r122189 | lattner | 2010-12-19 12:19:20 -0800 (Sun, 19 Dec 2010) | 3 lines

now that generic vector types aren't selected onto MMX operations,
we don't need -disable-mmx anymore.

------------------------------------------------------------------------
r122188 | lattner | 2010-12-19 12:12:58 -0800 (Sun, 19 Dec 2010) | 3 lines

now that generic vector types aren't selected onto MMX registers, these
tests don't need -disable-mmx.
Comment 2 Vinson Lee 2010-12-23 09:48:16 UTC
commit 492afbce18af21ce5bbc89675c797e45a0b72bf5
Author: Vinson Lee <vlee@vmware.com>
Date:   Wed Dec 22 19:44:00 2010 -0800

    gallivm: Disable MMX-disabling code on llvm-2.9.
    
    The disable-mmx option was removed in llvm-2.9svn by revisions 122188
    and 122189.
    
    Fixes FDO bug 32564.

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
index f56ddee..46dd00d 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
+++ b/src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
@@ -144,6 +144,7 @@ lp_set_target_options(void)
    llvm::UnsafeFPMath = true;
 #endif
 
+#if HAVE_LLVM < 0x0209
    /*
     * LLVM will generate MMX instructions for vectors <= 64 bits, leading to
     * innefficient code, and in 32bit systems, to the corruption of the FPU
@@ -162,6 +163,7 @@ lp_set_target_options(void)
       llvm::cl::ParseCommandLineOptions(2, const_cast<char**>(options));
       first = FALSE;
    }
+#endif
 
    /*
     * By default LLVM adds a signal handler to output a pretty stack trace.
Comment 3 Vinson Lee 2011-01-09 00:36:52 UTC
mesa: 97195d04fd3d07c15dc8f22707c511f0798cfbc9 (master)

Verified fixed with llvm-2.9svn.
Comment 4 Jose Fonseca 2011-01-10 02:31:35 UTC
Thanks Vinson.
Comment 5 EoD 2011-04-19 17:04:09 UTC
As llvm-2.9 has been released I propose to merge this into the 7.10-branch.

My X server crashed after my upgrade today and it took me quite a while to figure out what's going wrong. Gentoo already uses this patch in their 7.10.2-r1 ebuild.
Comment 6 Jose Fonseca 2011-04-20 02:31:55 UTC
I've cherry-picked the relevant commit into 7.10.
Comment 7 EoD 2011-04-20 03:09:50 UTC
Thanks.

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.