[llvm] [VN] be more consistent about forwarding null inputs and ignoring SVE outputs (PR #139574)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 12 09:47:53 PDT 2025


================
@@ -317,6 +321,13 @@ static Value *getStoreValueForLoadHelper(Value *SrcVal, unsigned Offset,
                                          Type *LoadTy, IRBuilderBase &Builder,
                                          const DataLayout &DL) {
   LLVMContext &Ctx = SrcVal->getType()->getContext();
+  // If CI is a null value, the intermediate code formed later might be invalid
+  // (e.g. creating a ptrtoint on NI addrspace), since it is a special case in
+  // canCoerceMustAliasedValueToLoad, so instead form the NullValue for the load
+  // directly
+  if (auto *CI = dyn_cast<Constant>(getUnderlyingObject(SrcVal)))
----------------
nikic wrote:

What is this getUnderlyingObject doing here?

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


More information about the llvm-commits mailing list