summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExpr.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2012-11-17 17:30:55 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2012-11-17 17:30:55 +0000
commit37196de31e6eab348030ef08cf2c3a78af42ee83 (patch)
tree4f8fcbf8237fea44a28e266dd9743493269ea2fc /clang/lib/CodeGen/CGExpr.cpp
parent96e1e396420d45fb4a1d3891105390c53120e8f6 (diff)
downloadbcm5719-llvm-37196de31e6eab348030ef08cf2c3a78af42ee83.tar.gz
bcm5719-llvm-37196de31e6eab348030ef08cf2c3a78af42ee83.zip
Enable inlining of 4 byte atomic ops on ppc32, 8 byte atomic ops on ppc64.
Also fixes a bit/byte mismatch when checking if a target supports atomic ops of a certain size. llvm-svn: 168260
Diffstat (limited to 'clang/lib/CodeGen/CGExpr.cpp')
-rw-r--r--clang/lib/CodeGen/CGExpr.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 393d3b9704a..cb274fc4067 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -3166,11 +3166,10 @@ RValue CodeGenFunction::EmitAtomicExpr(AtomicExpr *E, llvm::Value *Dest) {
uint64_t Size = sizeChars.getQuantity();
CharUnits alignChars = getContext().getTypeAlignInChars(AtomicTy);
unsigned Align = alignChars.getQuantity();
- unsigned MaxInlineWidth =
- getContext().getTargetInfo().getMaxAtomicInlineWidth();
- bool UseLibcall = (Size != Align || Size > MaxInlineWidth);
-
-
+ unsigned MaxInlineWidthInBits =
+ getContext().getTargetInfo().getMaxAtomicInlineWidth();
+ bool UseLibcall = (Size != Align ||
+ getContext().toBits(sizeChars) > MaxInlineWidthInBits);
llvm::Value *Ptr, *Order, *OrderFail = 0, *Val1 = 0, *Val2 = 0;
Ptr = EmitScalarExpr(E->getPtr());
OpenPOWER on IntegriCloud