[PATCH] D22201: Add a 'Returned' intrinsic property corresponding to the 'returned' argument attribute.

Hal Finkel via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 10 18:36:09 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL275034: Add a 'Returned' intrinsic property corresponding to the 'returned' argument… (authored by hfinkel).

Changed prior to commit:
  http://reviews.llvm.org/D22201?vs=63430&id=63448#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D22201

Files:
  llvm/trunk/include/llvm/IR/Intrinsics.td
  llvm/trunk/utils/TableGen/CodeGenIntrinsics.h
  llvm/trunk/utils/TableGen/CodeGenTarget.cpp
  llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp

Index: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
===================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.cpp
+++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp
@@ -592,6 +592,9 @@
     else if (Property->isSubClassOf("NoCapture")) {
       unsigned ArgNo = Property->getValueAsInt("ArgNo");
       ArgumentAttributes.push_back(std::make_pair(ArgNo, NoCapture));
+    } else if (Property->isSubClassOf("Returned")) {
+      unsigned ArgNo = Property->getValueAsInt("ArgNo");
+      ArgumentAttributes.push_back(std::make_pair(ArgNo, Returned));
     } else if (Property->isSubClassOf("ReadOnly")) {
       unsigned ArgNo = Property->getValueAsInt("ArgNo");
       ArgumentAttributes.push_back(std::make_pair(ArgNo, ReadOnly));
Index: llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp
===================================================================
--- llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp
+++ llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp
@@ -548,6 +548,12 @@
             OS << "Attribute::NoCapture";
             addComma = true;
             break;
+          case CodeGenIntrinsic::Returned:
+            if (addComma)
+              OS << ",";
+            OS << "Attribute::Returned";
+            addComma = true;
+            break;
           case CodeGenIntrinsic::ReadOnly:
             if (addComma)
               OS << ",";
Index: llvm/trunk/utils/TableGen/CodeGenIntrinsics.h
===================================================================
--- llvm/trunk/utils/TableGen/CodeGenIntrinsics.h
+++ llvm/trunk/utils/TableGen/CodeGenIntrinsics.h
@@ -108,7 +108,7 @@
   /// True if the intrinsic is marked as convergent.
   bool isConvergent;
 
-  enum ArgAttribute { NoCapture, ReadOnly, WriteOnly, ReadNone };
+  enum ArgAttribute { NoCapture, Returned, ReadOnly, WriteOnly, ReadNone };
   std::vector<std::pair<unsigned, ArgAttribute>> ArgumentAttributes;
 
   CodeGenIntrinsic(Record *R);
Index: llvm/trunk/include/llvm/IR/Intrinsics.td
===================================================================
--- llvm/trunk/include/llvm/IR/Intrinsics.td
+++ llvm/trunk/include/llvm/IR/Intrinsics.td
@@ -54,6 +54,12 @@
   int ArgNo = argNo;
 }
 
+// Returned - The specified argument is always the return value of the
+// intrinsic.
+class Returned<int argNo> : IntrinsicProperty {
+  int ArgNo = argNo;
+}
+
 // ReadOnly - The specified argument pointer is not written to through the
 // pointer by the intrinsic.
 class ReadOnly<int argNo> : IntrinsicProperty {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22201.63448.patch
Type: text/x-patch
Size: 2542 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160711/6f3c6fcd/attachment.bin>


More information about the llvm-commits mailing list