[llvm-bugs] [Bug 27361] New: TargetMachine is not thread safe (but it really should be)

via llvm-bugs llvm-bugs at lists.llvm.org
Thu Apr 14 17:17:05 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27361

            Bug ID: 27361
           Summary: TargetMachine is not thread safe (but it really should
                    be)
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Target Description Classes
          Assignee: unassignedbugs at nondot.org
          Reporter: davide at freebsd.org
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

When doing parallel CodeGen we currently have to create a TargetMachine
per-thread because TargetMachine is not thread-safe.
This is a waste, and it would be nice if it can be avoided. 
Also, having an immutable TargetMachine is a preliminary step needed if we want
at some point parallelize the backend.

Eric pointed out the least amount of work needed:
* Handle resetTargetOptions first (at least)
* An optional lock on getSubtarget

The subtarget itself should be fine, and if not, it should be fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20160415/291eb5cd/attachment-0001.html>


More information about the llvm-bugs mailing list