[llvm-commits] [llvm-gcc-4.2] r99593 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Mar 25 20:34:25 PDT 2010


On Mar 25, 2010, at 6:28 PM, Eric Christopher wrote:

> Author: echristo
> Date: Thu Mar 25 20:28:01 2010
> New Revision: 99593
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=99593&view=rev
> Log:
> Try to lower in the backend first, it may know what to do better for the
> target.

Thanks, Eric!

When I tried this earlier on _mm_loadu_si128(), it got lowered as an IR load instead of an intrinsic as I wanted, but the 'align 1' was lost somehow. IIRC, it was correct at -O0, but wrong with optimization on.

I'll test it in the morning, I don't have an i7 to build llvm-gcc at home :-(


> 
> Modified:
>    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
> 
> Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=99593&r1=99592&r2=99593&view=diff
> ==============================================================================
> --- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
> +++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Thu Mar 25 20:28:01 2010
> @@ -4955,8 +4955,7 @@
> //                     ... Builtin Function Expansion ...
> //===----------------------------------------------------------------------===//
> 
> -/// EmitFrontendExpandedBuiltinCall - For MD builtins that do not have a
> -/// directly corresponding LLVM intrinsic, we allow the target to do some amount
> +/// EmitFrontendExpandedBuiltinCall - We allow the target to do some amount
> /// of lowering.  This allows us to avoid having intrinsics for operations that
> /// directly correspond to LLVM constructs.
> ///
> @@ -5112,14 +5111,17 @@
> #ifdef LLVM_TARGET_INTRINSIC_PREFIX
>       TargetPrefix = LLVM_TARGET_INTRINSIC_PREFIX;
> #endif
> +      // If the backend has some special code to lower, go ahead and try to
> +      // do that first.
> +      if (EmitFrontendExpandedBuiltinCall(exp, fndecl, DestLoc, Result))
> +        return true;
> +      
>       // If this builtin directly corresponds to an LLVM intrinsic, get the
>       // IntrinsicID now.
>       const char *BuiltinName = IDENTIFIER_POINTER(DECL_NAME(fndecl));
>       Intrinsic::ID IntrinsicID =
>         Intrinsic::getIntrinsicForGCCBuiltin(TargetPrefix, BuiltinName);
>       if (IntrinsicID == Intrinsic::not_intrinsic) {
> -        if (EmitFrontendExpandedBuiltinCall(exp, fndecl, DestLoc, Result))
> -          return true;
> 
>         error("%Hunsupported target builtin %<%s%> used", &EXPR_LOCATION(exp),
>               BuiltinName);
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list