[PATCH] D42154: Don't generate inline atomics for i386/i486

Wei Mi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 16 17:40:21 PST 2018


wmi created this revision.
wmi added reviewers: rjmccall, eli.friedman, rsmith.
Herald added subscribers: cfe-commits, eraman, sanjoy.

This is to fix the bug reported in https://bugs.llvm.org/show_bug.cgi?id=34347#c6

Currently, all  MaxAtomicInlineWidth of x86-32 targets are set to 64. However, i386 doesn't support any cmpxchg related instructions. i486 only supports cmpxchg. So in this patch MaxAtomicInlineWidth is reset as follows.
For i486, the MaxAtomicInlineWidth should be 32 because it supports cmpxchg. 
For i386, the MaxAtomicInlineWidth should be 0. 
For others x86-32 cpu, the MaxAtomicInlineWidth should be 64 because of cmpxchg8b.


Repository:
  rC Clang

https://reviews.llvm.org/D42154

Files:
  lib/Basic/Targets/X86.h
  test/CodeGenCXX/atomic-inline.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42154.130076.patch
Type: text/x-patch
Size: 4231 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180117/311aae9a/attachment.bin>


More information about the cfe-commits mailing list