[Mlir-commits] [llvm] [mlir] [IR][ModRef] Introduce `errno` memory location (PR #120783)
Nikita Popov
llvmlistbot at llvm.org
Mon Feb 10 08:11:24 PST 2025
================
@@ -2293,9 +2318,21 @@ static bool upgradeOldMemoryAttribute(MemoryEffects &ME, uint64_t EncodedKind) {
case bitc::ATTR_KIND_INACCESSIBLEMEM_ONLY:
ME &= MemoryEffects::inaccessibleMemOnly();
return true;
+ case bitc::ATTR_KIND_ERRNOMEMONLY:
+ ME &= MemoryEffects::errnoMemOnly();
+ return true;
case bitc::ATTR_KIND_INACCESSIBLEMEM_OR_ARGMEMONLY:
ME &= MemoryEffects::inaccessibleOrArgMemOnly();
return true;
+ case bitc::ATTR_KIND_INACCESSIBLEMEM_OR_ERRNOMEMONLY:
+ ME &= MemoryEffects::inaccessibleOrErrnoMemOnly();
+ return true;
+ case bitc::ATTR_KIND_ARGMEM_OR_ERRNOMEMONLY:
+ ME &= MemoryEffects::argumentOrErrnoMemOnly();
+ return true;
+ case bitc::ATTR_KIND_INACCESSIBLEMEM_OR_ARGMEM_OR_ERRNOMEMONLY:
+ ME &= MemoryEffects::inaccessibleOrArgOrErrnoMemOnly();
+ return true;
----------------
nikic wrote:
decodeLLVMAttributesForBitcode is not relevant for this kind of attribute. The place to perform the upgrade would be here: https://github.com/llvm/llvm-project/blob/83af335ea47b50037beb46e5d6fb04be89f3b207/llvm/lib/Bitcode/Reader/BitcodeReader.cpp#L2401-L2402
And the version can be added on the encoding side here: https://github.com/llvm/llvm-project/blob/83af335ea47b50037beb46e5d6fb04be89f3b207/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp#L981 This would be handling just for MemoryEffects, not generically for all attributes.
https://github.com/llvm/llvm-project/pull/120783
More information about the Mlir-commits
mailing list