[PATCH] D71128: [NVPTX][FIX] Expand atomics we cannot handle natively in the ISA

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 6 09:53:33 PST 2019


jdoerfert created this revision.
jdoerfert added reviewers: tra, arsenm.
Herald added subscribers: jfb, bollu, hiraditya, wdng, jholewinski.
Herald added a project: LLVM.

NOTE: This is lacking a test and more of a request for feedback (I'm not
      an NVPTX person).

See also PR4219.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71128

Files:
  llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp


Index: llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
===================================================================
--- llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -357,6 +357,11 @@
   // condition branches.
   setJumpIsExpensive(true);
 
+  // Force atomics to be expanded if the ISA doesn't support them: PR4219
+  setMinCmpXchgSizeInBits(32);
+  setMaxAtomicSizeInBitsSupported(64);
+  setSupportsUnalignedAtomics(false);
+
   // Wide divides are _very_ slow. Try to reduce the width of the divide if
   // possible.
   addBypassSlowDiv(64, 32);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71128.232596.patch
Type: text/x-patch
Size: 603 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191206/06ef1cb3/attachment.bin>


More information about the llvm-commits mailing list