[PATCH] D55435: [AMDGPU] Fix discarded result of addAttribute

Brian Gesiak via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 9 14:00:29 PST 2018


This revision was automatically updated to reflect the committed changes.
Closed by commit rL348732: [AMDGPU] Fix discarded result of addAttribute (authored by modocache, committed by ).

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55435/new/

https://reviews.llvm.org/D55435

Files:
  llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp
  llvm/trunk/test/CodeGen/AMDGPU/simplify-libcalls.ll


Index: llvm/trunk/test/CodeGen/AMDGPU/simplify-libcalls.ll
===================================================================
--- llvm/trunk/test/CodeGen/AMDGPU/simplify-libcalls.ll
+++ llvm/trunk/test/CodeGen/AMDGPU/simplify-libcalls.ll
@@ -783,5 +783,10 @@
   ret void
 }
 
+; GCN-PRELINK: declare float @_Z4fabsf(float) local_unnamed_addr #[[$NOUNWIND_READONLY:[0-9]+]]
+; GCN-PRELINK: declare float @_Z4cbrtf(float) local_unnamed_addr #[[$NOUNWIND_READONLY]]
+; GCN-PRELINK: declare float @_Z11native_sqrtf(float) local_unnamed_addr #[[$NOUNWIND_READONLY]]
+
 ; CGN-PRELINK: attributes #[[$NOUNWIND]] = { nounwind }
+; GCN-PRELINK: attributes #[[$NOUNWIND_READONLY]] = { nounwind readonly }
 attributes #0 = { nounwind }
Index: llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp
===================================================================
--- llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp
+++ llvm/trunk/lib/Target/AMDGPU/AMDGPULibFunc.cpp
@@ -995,8 +995,10 @@
   } else {
     AttributeList Attr;
     LLVMContext &Ctx = M->getContext();
-    Attr.addAttribute(Ctx, AttributeList::FunctionIndex, Attribute::ReadOnly);
-    Attr.addAttribute(Ctx, AttributeList::FunctionIndex, Attribute::NoUnwind);
+    Attr = Attr.addAttribute(Ctx, AttributeList::FunctionIndex,
+                             Attribute::ReadOnly);
+    Attr = Attr.addAttribute(Ctx, AttributeList::FunctionIndex,
+                             Attribute::NoUnwind);
     C = M->getOrInsertFunction(FuncName, FuncTy, Attr);
   }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55435.177446.patch
Type: text/x-patch
Size: 1507 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181209/538bb9fb/attachment.bin>


More information about the llvm-commits mailing list