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

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 14 11:01:54 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:

Original code already cast V to Instruction, so we should indeed be OK as we're not changing existing behavior, just hoisting the cast out of the function.

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


More information about the llvm-commits mailing list