[llvm] [InferAddressSpaces] apply InferAddressSpaces to inttoptr-zext-ptrtoint address expression. (PR #79108)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 23:50:35 PDT 2024


================
@@ -356,8 +385,8 @@ getPointerOperands(const Value &V, const DataLayout &DL,
     return {II.getArgOperand(0)};
   }
   case Instruction::IntToPtr: {
-    assert(isNoopPtrIntCastPair(&Op, DL, TTI));
-    auto *P2I = cast<Operator>(Op.getOperand(0));
+    Operator *P2I = getNoopOrExtPtrIntCastPair(&Op, DL, TTI);
+    assert(P2I != nullptr);
----------------
arsenm wrote:

Could you just have getNoopOrExtPtrIntCastPair end in unreachable if this cannot happen? 

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


More information about the llvm-commits mailing list