[LLVMbugs] [Bug 3498] New: meta: __sync_fetch_ builtings not properly lowered to LLVM IR

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Fri Feb 6 02:16:37 PST 2009


           Summary: meta: __sync_fetch_ builtings not properly lowered to
                    LLVM IR
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: edwintorok at gmail.com
                CC: llvmbugs at cs.uiuc.edu

They currently emit only llvm.atomic.* intrinsics, but gcc defines the
semantics to also imply barriers:

"In most cases, these builtins are considered a "full barrier".  That
is, no memory operand will be moved across the operation, either
forward or backward.  Further, instructions will be issued as necessary
to prevent the processor from speculating loads across the operation
and from queuing stores after the operation.

All of the routines are are described in the Intel documentation to
take "an optional list of variables protected by the memory barrier".
It's not clear what is meant by that; it could mean that _only_ the
following variables are protected, or it could mean that these variables
should in addition be protected.  At present GCC ignores this list and
protects all variables which are globally accessible.  If in the future
we make some use of this list, an empty list will continue to mean all
globally accessible variables."

Frontend should lower them to barrier, atomic intrinsic, barrier.
Targets can then lower the barriers to NOPs if they are not needed by hardware,
but it will prevent the optimizers from moving memory operands accross.

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list