Ticket #5814 (closed bug: fixed)

Opened 4 months ago

Last modified 2 months ago

LLVM 3.0 doesn't support llvm.memory.barrier

Reported by: bgamari Owned by: dterei
Priority: normal Milestone:
Component: Compiler (LLVM) Version: 7.5
Keywords: Cc: ned2076@…, bgamari@…
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Difficulty: Unknown
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Support for the llvm.memory.barrier intrinsic was removed in LLVM 3.0  http://llvm.org/releases/3.0/docs/Atomics.html due to the introduction of the new "fence" instruction. The LLVM code generator should be updated accordingly.

Attachments

0001-llvmGen-Use-new-fence-instruction.patch Download (4.9 KB) - added by bgamari 4 months ago.
Preliminary patch

Change History

Changed 4 months ago by bgamari

  • version changed from 7.2.2 to 7.5

In the name of release early, release often I'm attaching my hacked patch to use the "fence" instruction. The code compiles and seems to run, but this is not to say that it is correct. In fact, there are at least two outstanding issues,

1) Logic needs to be wired up to emit llvm.memory.barrier when dealing with old LLVMs 2) Someone with greater knowledge of the synchronization requirements of cmm's write barrier primative should take a look at the LLVM atomics documentation ( http://llvm.org/releases/3.0/docs/Atomics.html) and ensure that my use of "fence" is correct

Changed 4 months ago by bgamari

Preliminary patch

Changed 4 months ago by bgamari

  • cc bgamari@… added

Changed 4 months ago by dterei

  • status changed from new to merge

OK pushed patch + some improvements. I changed the fence to use the strongest sync of seq_cst (sequentially consistent). I'm not sure if this is too much and perhaps your use of acq_rel (acquire+release) would be enough. Please check what actual machine code is generated by GHC and maybe talk to Simon M.

Changed 2 months ago by pcapriotti

  • status changed from merge to closed
  • difficulty set to Unknown
  • resolution set to fixed
Note: See TracTickets for help on using tickets.