[PATCH] D87140: [GlobalISel] Avoid making G_PTR_ADD with nullptr

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 07:31:43 PDT 2020


arsenm added inline comments.


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2737-2740
+    LLT ElemTy = Ty.getElementType();
+    if (ElemTy.isPointer()) {
+      if (DL.isNonIntegralAddressSpace(ElemTy.getAddressSpace()))
+        return false;
----------------
Combine the scalar and vector check above?


================
Comment at: llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp:2743
+      const MachineInstr *VecMI = MRI.getVRegDef(MI.getOperand(1).getReg());
+      return isBuildVectorAllZeros(*VecMI, MRI);
+    }
----------------
I have a patch to generalize these checks I haven't posted yet, but I guess having the two paths is fine for now


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D87140/new/

https://reviews.llvm.org/D87140



More information about the llvm-commits mailing list