[llvm] InferAddressSpaces: Make getPredicatedAddrSpace less confusing (PR #104052)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 10:43:17 PDT 2024


================
@@ -989,7 +986,8 @@ bool InferAddressSpacesImpl::updateAddressSpace(
           OperandAS = PtrOperand->getType()->getPointerAddressSpace();
           if (OperandAS == FlatAddrSpace) {
             // Check AC for assumption dominating V.
-            unsigned AS = getPredicatedAddrSpace(V, PtrOperand);
+            unsigned AS =
+                getPredicatedAddrSpace(*PtrOperand, &cast<Instruction>(V));
----------------
Artem-B wrote:

Can we always cast to `Instruction`? E.g. what if `V` is an `Argument`?

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


More information about the llvm-commits mailing list