[llvm] aa93d84 - [IR] NoFree IntrinsicProperty.
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jun 30 02:28:20 PDT 2020
Author: sstefan1
Date: 2020-06-30T11:26:00+02:00
New Revision: aa93d84db93451488fc9c645fb970b8f7e481292
URL: https://github.com/llvm/llvm-project/commit/aa93d84db93451488fc9c645fb970b8f7e481292
DIFF: https://github.com/llvm/llvm-project/commit/aa93d84db93451488fc9c645fb970b8f7e481292.diff
LOG: [IR] NoFree IntrinsicProperty.
Summary:
Separate introduction of IntrNoFree property as suggested in D70365
Reviewers: arsenm, nhaehnle
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82587
Added:
Modified:
llvm/include/llvm/IR/Intrinsics.td
llvm/utils/TableGen/CodeGenIntrinsics.h
llvm/utils/TableGen/CodeGenTarget.cpp
llvm/utils/TableGen/IntrinsicEmitter.cpp
Removed:
################################################################################
diff --git a/llvm/include/llvm/IR/Intrinsics.td b/llvm/include/llvm/IR/Intrinsics.td
index 1af5588f5f56..433e24979ab9 100644
--- a/llvm/include/llvm/IR/Intrinsics.td
+++ b/llvm/include/llvm/IR/Intrinsics.td
@@ -117,6 +117,8 @@ class ReadNone<AttrIndex idx> : IntrinsicProperty {
def IntrNoReturn : IntrinsicProperty;
+def IntrNoFree : IntrinsicProperty;
+
def IntrWillReturn : IntrinsicProperty;
// IntrCold - Calls to this intrinsic are cold.
diff --git a/llvm/utils/TableGen/CodeGenIntrinsics.h b/llvm/utils/TableGen/CodeGenIntrinsics.h
index 6503f39cfd8e..af59c1f3d833 100644
--- a/llvm/utils/TableGen/CodeGenIntrinsics.h
+++ b/llvm/utils/TableGen/CodeGenIntrinsics.h
@@ -126,6 +126,9 @@ struct CodeGenIntrinsic {
/// True if the intrinsic is no-sync.
bool isNoSync;
+ /// True if the intrinsic is no-free.
+ bool isNoFree;
+
/// True if the intrinsic is will-return.
bool isWillReturn;
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index 31f9f63d1684..3b53a8531d3f 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -624,6 +624,7 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
canThrow = false;
isNoReturn = false;
isNoSync = false;
+ isNoFree = false;
isWillReturn = false;
isCold = false;
isNoDuplicate = false;
@@ -790,6 +791,8 @@ CodeGenIntrinsic::CodeGenIntrinsic(Record *R) {
isNoReturn = true;
else if (Property->getName() == "IntrNoSync")
isNoSync = true;
+ else if (Property->getName() == "IntrNoFree")
+ isNoFree = true;
else if (Property->getName() == "IntrWillReturn")
isWillReturn = true;
else if (Property->getName() == "IntrCold")
diff --git a/llvm/utils/TableGen/IntrinsicEmitter.cpp b/llvm/utils/TableGen/IntrinsicEmitter.cpp
index ab42f33cf23f..7e4191494149 100644
--- a/llvm/utils/TableGen/IntrinsicEmitter.cpp
+++ b/llvm/utils/TableGen/IntrinsicEmitter.cpp
@@ -584,6 +584,9 @@ struct AttributeComparator {
if (L->isNoSync != R->isNoSync)
return R->isNoSync;
+ if (L->isNoFree != R->isNoFree)
+ return R->isNoFree;
+
if (L->isWillReturn != R->isWillReturn)
return R->isWillReturn;
@@ -751,10 +754,11 @@ void IntrinsicEmitter::EmitAttributes(const CodeGenIntrinsicTable &Ints,
}
if (!intrinsic.canThrow ||
- (intrinsic.ModRef != CodeGenIntrinsic::ReadWriteMem && !intrinsic.hasSideEffects) ||
- intrinsic.isNoReturn || intrinsic.isNoSync || intrinsic.isWillReturn ||
- intrinsic.isCold || intrinsic.isNoDuplicate || intrinsic.isConvergent ||
- intrinsic.isSpeculatable) {
+ (intrinsic.ModRef != CodeGenIntrinsic::ReadWriteMem &&
+ !intrinsic.hasSideEffects) ||
+ intrinsic.isNoReturn || intrinsic.isNoSync || intrinsic.isNoFree ||
+ intrinsic.isWillReturn || intrinsic.isCold || intrinsic.isNoDuplicate ||
+ intrinsic.isConvergent || intrinsic.isSpeculatable) {
OS << " const Attribute::AttrKind Atts[] = {";
bool addComma = false;
if (!intrinsic.canThrow) {
@@ -773,6 +777,12 @@ void IntrinsicEmitter::EmitAttributes(const CodeGenIntrinsicTable &Ints,
OS << "Attribute::NoSync";
addComma = true;
}
+ if (intrinsic.isNoFree) {
+ if (addComma)
+ OS << ",";
+ OS << "Attribute::NoFree";
+ addComma = true;
+ }
if (intrinsic.isWillReturn) {
if (addComma)
OS << ",";
More information about the llvm-commits
mailing list