lewis-revill created this revision.
lewis-revill added a reviewer: asb.
Herald added subscribers: cfe-commits, jocewei, PkmX, jfb, rkruppe, the_o, 
brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, 
kito-cheng, niosHD, sabuasal, apazos, simoncook, johnrusso, rbar.

This prevents Clang from generating libcalls which are not necessary when the 
target has atomic support.


Repository:
  rC Clang

https://reviews.llvm.org/D57242

Files:
  lib/Basic/Targets/RISCV.h


Index: lib/Basic/Targets/RISCV.h
===================================================================
--- lib/Basic/Targets/RISCV.h
+++ lib/Basic/Targets/RISCV.h
@@ -77,6 +77,7 @@
     IntPtrType = SignedInt;
     PtrDiffType = SignedInt;
     SizeType = UnsignedInt;
+    MaxAtomicInlineWidth = 32;
     resetDataLayout("e-m:e-p:32:32-i64:64-n32-S128");
   }
 
@@ -95,6 +96,7 @@
       : RISCVTargetInfo(Triple, Opts) {
     LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
     IntMaxType = Int64Type = SignedLong;
+    MaxAtomicInlineWidth = 64;
     resetDataLayout("e-m:e-p:64:64-i64:64-i128:128-n64-S128");
   }
 


Index: lib/Basic/Targets/RISCV.h
===================================================================
--- lib/Basic/Targets/RISCV.h
+++ lib/Basic/Targets/RISCV.h
@@ -77,6 +77,7 @@
     IntPtrType = SignedInt;
     PtrDiffType = SignedInt;
     SizeType = UnsignedInt;
+    MaxAtomicInlineWidth = 32;
     resetDataLayout("e-m:e-p:32:32-i64:64-n32-S128");
   }
 
@@ -95,6 +96,7 @@
       : RISCVTargetInfo(Triple, Opts) {
     LongWidth = LongAlign = PointerWidth = PointerAlign = 64;
     IntMaxType = Int64Type = SignedLong;
+    MaxAtomicInlineWidth = 64;
     resetDataLayout("e-m:e-p:64:64-i64:64-i128:128-n64-S128");
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to