[llvm] [RFC][IR] Support vector splats in `ConstantPointerNull` (PR #195486)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon May 4 03:31:04 PDT 2026


================
@@ -2001,11 +2041,19 @@ ConstantRange Constant::toConstantRange() const {
 //
 
 ConstantPointerNull *ConstantPointerNull::get(PointerType *Ty) {
+  return get(static_cast<Type *>(Ty));
+}
+
+ConstantPointerNull *ConstantPointerNull::get(Type *Ty) {
+  assert((Ty->isPointerTy() ||
+          (Ty->isVectorTy() && Ty->getScalarType()->isPointerTy())) &&
----------------
arsenm wrote:

```suggestion
  assert((Ty->isPtrOrPtrVectorTy() &&
```

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


More information about the llvm-commits mailing list