Re: [Mesa-dev] [PATCH 1/3] gallivm: Emit vector selects.

2013-04-22 Thread Roland Scheidegger
Am 20.04.2013 10:57, schrieb jfons...@vmware.com:
> From: José Fonseca 
> 
> They are supported on LLVM 3.1, at least on x86. (I haven't tested on PPC
> though.)
> 
> Actually lp_build_linear_mip_levels() already has been emitting them for
> some time.
> 
> This avoids intrinsics, which tend to be an obstacle for certain
> optimization passes.
> ---
>  src/gallium/auxiliary/gallivm/lp_bld_logic.c |   14 ++
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c 
> b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
> index f56b61b..cdb7e0a 100644
> --- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c
> +++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
> @@ -458,20 +458,10 @@ lp_build_select(struct lp_build_context *bld,
>mask = LLVMBuildTrunc(builder, mask, LLVMInt1TypeInContext(lc), "");
>res = LLVMBuildSelect(builder, mask, a, b, "");
> }
> -   else if (0) {
> +   else if (HAVE_LLVM >= 0x301) {
>/* Generate a vector select.
> *
> -   * XXX: Using vector selects would avoid emitting intrinsics, but they 
> aren't
> -   * properly supported yet.
> -   *
> -   * LLVM 3.0 includes experimental support provided the 
> -promote-elements
> -   * options is passed to LLVM's command line (e.g., via
> -   * llvm::cl::ParseCommandLineOptions), but resulting code quality is 
> much
> -   * worse, probably because some optimization passes don't know how to
> -   * handle vector selects.
> -   *
> -   * See also:
> -   * - 
> http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043659.html
> +   * Only supported on LLVM 3.1 onwards
> */
>  
>/* Convert the mask to a vector of booleans.
> 

Series looks good to me.

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


Re: [Mesa-dev] [PATCH 1/3] gallivm: Emit vector selects.

2013-04-20 Thread Brian Paul

On 04/20/2013 02:57 AM, jfons...@vmware.com wrote:

From: José Fonseca

They are supported on LLVM 3.1, at least on x86. (I haven't tested on PPC
though.)

Actually lp_build_linear_mip_levels() already has been emitting them for
some time.

This avoids intrinsics, which tend to be an obstacle for certain
optimization passes.
---
  src/gallium/auxiliary/gallivm/lp_bld_logic.c |   14 ++
  1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c 
b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
index f56b61b..cdb7e0a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
@@ -458,20 +458,10 @@ lp_build_select(struct lp_build_context *bld,
mask = LLVMBuildTrunc(builder, mask, LLVMInt1TypeInContext(lc), "");
res = LLVMBuildSelect(builder, mask, a, b, "");
 }
-   else if (0) {
+   else if (HAVE_LLVM>= 0x301) {
/* Generate a vector select.
 *
-   * XXX: Using vector selects would avoid emitting intrinsics, but they 
aren't
-   * properly supported yet.
-   *
-   * LLVM 3.0 includes experimental support provided the -promote-elements
-   * options is passed to LLVM's command line (e.g., via
-   * llvm::cl::ParseCommandLineOptions), but resulting code quality is much
-   * worse, probably because some optimization passes don't know how to
-   * handle vector selects.
-   *
-   * See also:
-   * - http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043659.html
+   * Only supported on LLVM 3.1 onwards
 */

/* Convert the mask to a vector of booleans.


For the series, Reviewed-by: Brian Paul 

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


[Mesa-dev] [PATCH 1/3] gallivm: Emit vector selects.

2013-04-20 Thread jfonseca
From: José Fonseca 

They are supported on LLVM 3.1, at least on x86. (I haven't tested on PPC
though.)

Actually lp_build_linear_mip_levels() already has been emitting them for
some time.

This avoids intrinsics, which tend to be an obstacle for certain
optimization passes.
---
 src/gallium/auxiliary/gallivm/lp_bld_logic.c |   14 ++
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/src/gallium/auxiliary/gallivm/lp_bld_logic.c 
b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
index f56b61b..cdb7e0a 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_logic.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_logic.c
@@ -458,20 +458,10 @@ lp_build_select(struct lp_build_context *bld,
   mask = LLVMBuildTrunc(builder, mask, LLVMInt1TypeInContext(lc), "");
   res = LLVMBuildSelect(builder, mask, a, b, "");
}
-   else if (0) {
+   else if (HAVE_LLVM >= 0x301) {
   /* Generate a vector select.
*
-   * XXX: Using vector selects would avoid emitting intrinsics, but they 
aren't
-   * properly supported yet.
-   *
-   * LLVM 3.0 includes experimental support provided the -promote-elements
-   * options is passed to LLVM's command line (e.g., via
-   * llvm::cl::ParseCommandLineOptions), but resulting code quality is much
-   * worse, probably because some optimization passes don't know how to
-   * handle vector selects.
-   *
-   * See also:
-   * - http://lists.cs.uiuc.edu/pipermail/llvmdev/2011-October/043659.html
+   * Only supported on LLVM 3.1 onwards
*/
 
   /* Convert the mask to a vector of booleans.
-- 
1.7.9.5

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