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

Wei Mi via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 22 09:32:06 PST 2018


wmi added a comment.

In https://reviews.llvm.org/D42154#983840, @rjmccall wrote:

> In https://reviews.llvm.org/D42154#977991, @wmi wrote:
>
> > In https://reviews.llvm.org/D42154#977975, @efriedma wrote:
> >
> > > The LLVM backend currently assumes every CPU is Pentium-compatible.  If we're going to change that in clang, we should probably fix the backend as well.
> >
> >
> > With the patch, for i386/i486 targets, clang will generate more atomic libcalls than before, for which llvm backend will not do anything extra, so no fix is necessary in llvm backend for the patch to work.
>
>
> I think Eli's point is that we do not currently support generating code for the 386 and 486 because there are other things in the x86 backend that assume that the target is at minimum a Pentium.  If you're looking to support targeting those chips, you should look into that.


I am not looking to support those chips. Just because https://reviews.llvm.org/rL314145 changed the status of FreeBSD ports on 32 bits x86 as reported in https://bugs.llvm.org/show_bug.cgi?id=34347#c6, I want to provide a workaround and give them a relief. 
This is also the intention of keeping MaxAtomicInlineWidth to be 64 for CK_Generic. In this way, it provides the minimum churn for current status -- otherwise at least a bunch of tests need to be fixed.


Repository:
  rC Clang

https://reviews.llvm.org/D42154





More information about the cfe-commits mailing list