File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
llvm/lib/Transforms/Scalar Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -3221,12 +3221,16 @@ class AllocaSliceRewriter : public InstVisitor<AllocaSliceRewriter, bool> {
32213221 return V;
32223222
32233223 Type *SplatIntTy = Type::getIntNTy (VTy->getContext (), Size * 8 );
3224- V = IRB.CreateMul (
3225- IRB.CreateZExt (V, SplatIntTy, " zext" ),
3226- IRB.CreateUDiv (Constant::getAllOnesValue (SplatIntTy),
3227- IRB.CreateZExt (Constant::getAllOnesValue (V->getType ()),
3228- SplatIntTy)),
3229- " isplat" );
3224+ if (isa<UndefValue>(V)) {
3225+ V = UndefValue::get (VTy);
3226+ } else {
3227+ V = IRB.CreateMul (
3228+ IRB.CreateZExt (V, SplatIntTy, " zext" ),
3229+ IRB.CreateUDiv (Constant::getAllOnesValue (SplatIntTy),
3230+ IRB.CreateZExt (Constant::getAllOnesValue (V->getType ()),
3231+ SplatIntTy)),
3232+ " isplat" );
3233+ }
32303234 return V;
32313235 }
32323236
You can’t perform that action at this time.
0 commit comments