[llvm-commits] [llvm-gcc-4.2] r99593 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
Eric Christopher
echristo at apple.com
Thu Mar 25 18:28:01 PDT 2010
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.
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);
More information about the llvm-commits
mailing list