[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

Wenju He via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 22 17:17:43 PDT 2025


================
@@ -0,0 +1,25 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=instcombine %s | FileCheck %s
+
+; Check that `select B, true, C` isn't optimized to `or B, C`,
+; because the invalid addrspacecast %asc.shared may introduce poison.
----------------
wenju-he wrote:

> Description is slightly inaccurate. In this case it will always be poison

done

https://github.com/llvm/llvm-project/pull/144686


More information about the cfe-commits mailing list