[llvm] r275034 - 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:28:42 PDT 2016
Author: hfinkel
Date: Sun Jul 10 20:28:42 2016
New Revision: 275034
URL: http://llvm.org/viewvc/llvm-project?rev=275034&view=rev
Log:
Add a 'Returned' intrinsic property corresponding to the 'returned' argument attribute
This will be used by the upcoming llvm.noalias intrinsic.
Differential Revision: http://reviews.llvm.org/D22201
Modified:
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
Modified: llvm/trunk/include/llvm/IR/Intrinsics.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Intrinsics.td?rev=275034&r1=275033&r2=275034&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Intrinsics.td (original)
+++ llvm/trunk/include/llvm/IR/Intrinsics.td Sun Jul 10 20:28:42 2016
@@ -54,6 +54,12 @@ class NoCapture<int argNo> : IntrinsicPr
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 {
Modified: llvm/trunk/utils/TableGen/CodeGenIntrinsics.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenIntrinsics.h?rev=275034&r1=275033&r2=275034&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenIntrinsics.h (original)
+++ llvm/trunk/utils/TableGen/CodeGenIntrinsics.h Sun Jul 10 20:28:42 2016
@@ -108,7 +108,7 @@ struct CodeGenIntrinsic {
/// 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);
Modified: llvm/trunk/utils/TableGen/CodeGenTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/CodeGenTarget.cpp?rev=275034&r1=275033&r2=275034&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/CodeGenTarget.cpp (original)
+++ llvm/trunk/utils/TableGen/CodeGenTarget.cpp Sun Jul 10 20:28:42 2016
@@ -592,6 +592,9 @@ CodeGenIntrinsic::CodeGenIntrinsic(Recor
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));
Modified: llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp?rev=275034&r1=275033&r2=275034&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/IntrinsicEmitter.cpp Sun Jul 10 20:28:42 2016
@@ -548,6 +548,12 @@ EmitAttributes(const std::vector<CodeGen
OS << "Attribute::NoCapture";
addComma = true;
break;
+ case CodeGenIntrinsic::Returned:
+ if (addComma)
+ OS << ",";
+ OS << "Attribute::Returned";
+ addComma = true;
+ break;
case CodeGenIntrinsic::ReadOnly:
if (addComma)
OS << ",";
More information about the llvm-commits
mailing list