aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
diff options
context:
space:
mode:
authorAntonio Frighetto <me@antoniofrighetto.com>2025-09-24 15:59:32 +0200
committerAntonio Frighetto <me@antoniofrighetto.com>2025-09-24 15:59:32 +0200
commit32c6e162462bbca3beb2259b90cc922a7419ba2c (patch)
tree9f0267bbb5519da8472272dfd6ea6b8249100d8c /llvm/lib/Bitcode/Reader/BitcodeReader.cpp
parent03742c5dacef177a990f0fa3a3d11ba720fc0ac5 (diff)
downloadllvm-32c6e162462bbca3beb2259b90cc922a7419ba2c.zip
llvm-32c6e162462bbca3beb2259b90cc922a7419ba2c.tar.gz
llvm-32c6e162462bbca3beb2259b90cc922a7419ba2c.tar.bz2
[IR] Introduce `llvm.errno.tbaa` metadata for errno alias disambiguation
Add a new named module-level frontend-annotated metadata that specifies the TBAA node for an integer access, for which, C/C++ `errno` accesses are guaranteed to use (under strict aliasing). This should allow LLVM to prove the involved memory location/ accesses may not alias `errno`; thus, to perform optimizations around errno-writing libcalls (store-to-load forwarding amongst others). Previous discussion: https://discourse.llvm.org/t/rfc-modelling-errno-memory-effects/82972.
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
index 22a0d0f..832aa9f 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.cpp
@@ -7024,7 +7024,7 @@ Error BitcodeReader::materialize(GlobalValue *GV) {
if (!MDLoader->isStrippingTBAA()) {
for (auto &I : instructions(F)) {
MDNode *TBAA = I.getMetadata(LLVMContext::MD_tbaa);
- if (!TBAA || TBAAVerifyHelper.visitTBAAMetadata(I, TBAA))
+ if (!TBAA || TBAAVerifyHelper.visitTBAAMetadata(&I, TBAA))
continue;
MDLoader->setStripTBAA(true);
stripTBAA(F->getParent());