summaryrefslogtreecommitdiff
path: root/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
commit7baa711e61258a762db42e449e424bd0928318a6 (patch)
tree38d36fea69dab12c7478f34adb93422970efd37a /lib/CodeGen/CGExpr.cpp
parent48a7345a0bffcb01290447c73c6f17680d80f02f (diff)
downloadclang-7baa711e61258a762db42e449e424bd0928318a6.tar.gz
clang-7baa711e61258a762db42e449e424bd0928318a6.tar.bz2
clang-7baa711e61258a762db42e449e424bd0928318a6.tar.xz
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@168260 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
-rw-r--r--lib/CodeGen/CGExpr.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp
index 393d3b9704..cb274fc406 100644
--- a/lib/CodeGen/CGExpr.cpp
+++ b/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());