[llvm] [ConstantFolding] Support ptrtoaddr in cast folds (PR #162480)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 8 11:45:56 PDT 2025


================
@@ -2,6 +2,12 @@
 ; RUN: opt < %s -passes=instcombine -S | FileCheck %s
 target datalayout = "p1:64:64:64:32"
----------------
arichardson wrote:

```suggestion
;; The ptrtoaddr folds are also valid for pointers that have external state or are unstable
target datalayout = "peu1:64:64:64:32"
```
Could change this to show the fold is also valid for unstable and pointers with external state (or duplicate the tests for each of these but that seems like too much effort).

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


More information about the llvm-commits mailing list