[llvm-branch-commits] [llvm-gcc-branch] r91351 - in /llvm-gcc-4.2/branches/Apple/Zoidberg/gcc: llvm-convert.cpp llvm-internal.h
Jim Grosbach
grosbach at apple.com
Mon Dec 14 14:41:51 PST 2009
Author: grosbach
Date: Mon Dec 14 16:41:51 2009
New Revision: 91351
URL: http://llvm.org/viewvc/llvm-project?rev=91351&view=rev
Log:
merge 91350
Modified:
llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp
llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-internal.h
Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp?rev=91351&r1=91350&r2=91351&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-convert.cpp Mon Dec 14 16:41:51 2009
@@ -4762,14 +4762,14 @@
TargetBuiltinCache.clear();
}
-void TreeToLLVM::EmitMemoryBarrier(bool ll, bool ls, bool sl, bool ss) {
+void TreeToLLVM::EmitMemoryBarrier(bool ll, bool ls, bool sl, bool ss,
+ bool device) {
Value* C[5];
C[0] = ConstantInt::get(Type::getInt1Ty(Context), ll);
C[1] = ConstantInt::get(Type::getInt1Ty(Context), ls);
C[2] = ConstantInt::get(Type::getInt1Ty(Context), sl);
C[3] = ConstantInt::get(Type::getInt1Ty(Context), ss);
- // Be conservatively safe.
- C[4] = ConstantInt::get(Type::getInt1Ty(Context), true);
+ C[4] = ConstantInt::get(Type::getInt1Ty(Context), device);
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
Intrinsic::memory_barrier),
@@ -4792,7 +4792,11 @@
"cast");
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Value *Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule, id,
Ty, 2),
@@ -4821,7 +4825,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Value *Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
@@ -4831,7 +4839,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
if (isBool)
Result = CastToUIntType(Builder.CreateICmpEQ(Result, C[1]),
@@ -5399,7 +5411,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
@@ -5409,7 +5425,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result = Builder.CreateAdd(Result, C[1]);
Result = Builder.CreateIntToPtr(Result, ResultTy);
@@ -5445,7 +5465,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
@@ -5455,7 +5479,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result = Builder.CreateSub(Result, C[1]);
Result = Builder.CreateIntToPtr(Result, ResultTy);
@@ -5491,7 +5519,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
@@ -5501,7 +5533,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result = Builder.CreateOr(Result, C[1]);
Result = Builder.CreateIntToPtr(Result, ResultTy);
@@ -5534,7 +5570,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
@@ -5544,7 +5584,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result = Builder.CreateAnd(Result, C[1]);
Result = Builder.CreateIntToPtr(Result, ResultTy);
@@ -5580,7 +5624,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
@@ -5590,7 +5638,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result = Builder.CreateXor(Result, C[1]);
Result = Builder.CreateIntToPtr(Result, ResultTy);
@@ -5626,7 +5678,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result =
Builder.CreateCall(Intrinsic::getDeclaration(TheModule,
@@ -5636,7 +5692,11 @@
// The gcc builtins are also full memory barriers.
// FIXME: __sync_lock_test_and_set and __sync_lock_release require less.
- EmitMemoryBarrier(true, true, true, true);
+#if defined(TARGET_ARM) && defined(CONFIG_DARWIN_H)
+ EmitMemoryBarrier(true, true, true, true, false);
+#else
+ EmitMemoryBarrier(true, true, true, true, true);
+#endif
Result = Builder.CreateAnd(Builder.CreateNot(Result), C[1]);
Result = Builder.CreateIntToPtr(Result, ResultTy);
Modified: llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-internal.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-internal.h?rev=91351&r1=91350&r2=91351&view=diff
==============================================================================
--- llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-internal.h (original)
+++ llvm-gcc-4.2/branches/Apple/Zoidberg/gcc/llvm-internal.h Mon Dec 14 16:41:51 2009
@@ -500,7 +500,7 @@
void EmitModifyOfRegisterVariable(tree_node *vardecl, Value *RHS);
// Helpers for Builtin Function Expansion.
- void EmitMemoryBarrier(bool ll, bool ls, bool sl, bool ss);
+ void EmitMemoryBarrier(bool ll, bool ls, bool sl, bool ss, bool device);
Value *BuildVector(const std::vector<Value*> &Elts);
Value *BuildVector(Value *Elt, ...);
Value *BuildVectorShuffle(Value *InVec1, Value *InVec2, ...);
More information about the llvm-branch-commits
mailing list