summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorStefan Stipanovic <sstipanovic@s-energize.com>2019-07-11 21:37:40 +0000
committerStefan Stipanovic <sstipanovic@s-energize.com>2019-07-11 21:37:40 +0000
commit0626367202ced4ab46410c15357eed0ad8be6d5c (patch)
treeb501bcd56eabe89658e19db7b4497adc58b313e5 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent7d2019bb961f94eec476f255bb776d470ecd1b49 (diff)
downloadbcm5719-llvm-0626367202ced4ab46410c15357eed0ad8be6d5c.tar.gz
bcm5719-llvm-0626367202ced4ab46410c15357eed0ad8be6d5c.zip
[Attributor] Deduce "nosync" function attribute.
Introduce and deduce "nosync" function attribute to indicate that a function does not synchronize with another thread in a way that other thread might free memory. Reviewers: jdoerfert, jfb, nhaehnle, arsenm Subscribers: wdng, hfinkel, nhaenhle, mehdi_amini, steven_wu, dexonsmith, arsenm, uenoku, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D62766 llvm-svn: 365830
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 0ba76f0f371..09bd0f4ec71 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -1280,6 +1280,9 @@ static uint64_t getRawAttributeMask(Attribute::AttrKind Val) {
return 1ULL << 62;
case Attribute::NoFree:
return 1ULL << 63;
+ case Attribute::NoSync:
+ llvm_unreachable("nosync attribute not supported in raw format");
+ break;
case Attribute::Dereferenceable:
llvm_unreachable("dereferenceable attribute not supported in raw format");
break;
@@ -1305,7 +1308,8 @@ static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) {
if (I == Attribute::Dereferenceable ||
I == Attribute::DereferenceableOrNull ||
I == Attribute::ArgMemOnly ||
- I == Attribute::AllocSize)
+ I == Attribute::AllocSize ||
+ I == Attribute::NoSync)
continue;
if (uint64_t A = (Val & getRawAttributeMask(I))) {
if (I == Attribute::Alignment)
@@ -1466,6 +1470,8 @@ static Attribute::AttrKind getAttrFromCode(uint64_t Code) {
return Attribute::NoRedZone;
case bitc::ATTR_KIND_NO_RETURN:
return Attribute::NoReturn;
+ case bitc::ATTR_KIND_NOSYNC:
+ return Attribute::NoSync;
case bitc::ATTR_KIND_NOCF_CHECK:
return Attribute::NoCfCheck;
case bitc::ATTR_KIND_NO_UNWIND:
OpenPOWER on IntegriCloud