diff options
| author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-11-19 17:32:14 +0000 |
|---|---|---|
| committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-11-19 17:32:14 +0000 |
| commit | e8552efa949bad0fdf2f3221d37083c5056a0abf (patch) | |
| tree | fa59cd888083c299fbae2ec5299a03ead0a9f166 /lib/CodeGen/CGExpr.cpp | |
| parent | 7420b76579ea6658bd0019804dcd77a0c4fa0a08 (diff) | |
| download | clang-e8552efa949bad0fdf2f3221d37083c5056a0abf.tar.gz clang-e8552efa949bad0fdf2f3221d37083c5056a0abf.tar.bz2 clang-e8552efa949bad0fdf2f3221d37083c5056a0abf.tar.xz | |
Merge r168260 from trunk:
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/branches/release_32@168313 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index d1a2889f9a..63cc5b515d 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -3164,11 +3164,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()); |
