aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/IR/Value.cpp
diff options
context:
space:
mode:
authorPhilip Reames <listmail@philipreames.com>2021-07-14 13:19:48 -0700
committerPhilip Reames <listmail@philipreames.com>2021-07-14 13:26:18 -0700
commitb86ddfdb9a80f2343510e07209ceda59d72972e3 (patch)
treec43802b2e4519cdedb4f04f4ae2bd010b5442505 /llvm/lib/IR/Value.cpp
parentd37689e9ababe4badbc0132950425d8f3434a5b8 (diff)
downloadllvm-b86ddfdb9a80f2343510e07209ceda59d72972e3.zip
llvm-b86ddfdb9a80f2343510e07209ceda59d72972e3.tar.gz
llvm-b86ddfdb9a80f2343510e07209ceda59d72972e3.tar.bz2
Global variables with strong definitions cannot be freed
With the current deref semantics, this is redundant - since we assume that anything which is dereferenceable (ever) can't be freed - but it becomes neccessary for the deref-at-point semantics. Testing wise, this is covered by test/CodeGen/X86/hoist-invariant-load.ll when -use-dereferenceable-at-point-semantics is active. I didn't bother duplicating the command line since a) it's an in-development mode, and b) the change is pretty obvious.
Diffstat (limited to 'llvm/lib/IR/Value.cpp')
-rw-r--r--llvm/lib/IR/Value.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/IR/Value.cpp b/llvm/lib/IR/Value.cpp
index 9cb0056..1c59565 100644
--- a/llvm/lib/IR/Value.cpp
+++ b/llvm/lib/IR/Value.cpp
@@ -897,6 +897,7 @@ uint64_t Value::getPointerDereferenceableBytes(const DataLayout &DL,
// CanBeNull flag.
DerefBytes = DL.getTypeStoreSize(GV->getValueType()).getFixedSize();
CanBeNull = false;
+ CanBeFreed = false;
}
}
return DerefBytes;