1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 04:02:41 +01:00

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.
This commit is contained in:
Philip Reames 2021-07-14 13:19:48 -07:00
parent b12ecd2ebd
commit 652d77cf2f

View File

@ -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;