Kerang Mao 3890c97fc0
[InferAddressSpaces] Fix bad addrspacecast insertion for phinode (#163528)
The IR verifier will carsh if there is any instructions located before
phi-node. The `infer-address-spaces` pass would like to insert
`addrspacecast` before phi-node in some corner cases. Indeed, since the
operand pointer(phi-node's incoming value) has been determined to
`NewAS` by the pass, it is safe to `addrspacecast` it immediately after
the position where defined it.

Co-authored-by: Kerang Mao <krmao@birentech.com>
2025-11-14 18:55:05 +08:00
..