HomePhabricator

[InstCombine][SVE] Fix InstCombiner::visitAllocaInst for scalable vector.

Authored by huihuiz on Mar 18 2020, 8:46 PM.

Description

[InstCombine][SVE] Fix InstCombiner::visitAllocaInst for scalable vector.

Summary:
DataLayout::getTypeAllocSize() return TypeSize. For cases where scalable
property doesn't matter (check for zero-sized alloca), we should explicitly
call getKnownMinSize() to avoid implicit type conversion to uint64_t, which is
invalid for scalable vector type.

Reviewers: sdesmalen, efriedma, spatel, apazos

Reviewed By: efriedma

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D76386