[llvm] [InstCombine] Don't folder select to or if value argument is user of invalid addrspacecast inst (PR #144686)
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 19 00:31:57 PDT 2025
================
@@ -12621,6 +12621,9 @@ have no side effects, and must not capture the value of the pointer.
If the source is :ref:`poison <poisonvalues>`, the result is
:ref:`poison <poisonvalues>`.
+If the source is not :ref:`poison <poisonvalues>`, and the result pointer is
+non-dereferenceable, the result is :ref:`poison <poisonvalues>`.
----------------
nikic wrote:
This is incorrect, not every addrspacecast of a non-dereferenceable pointer should automatically result in poison (e.g. the pointer to the end of an object is non-dereferenceable, but should certainly not turn into poison).
This should instead say something along the lines of:
> Which address space casts are supported depends on the target. Unsupported address space casts return a poison value.
https://github.com/llvm/llvm-project/pull/144686
More information about the llvm-commits
mailing list