Page MenuHomePhabricator

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

Authored by huihuiz on Mar 18 2020, 2:36 PM.

Details

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.

Diff Detail

Event Timeline

huihuiz created this revision.Mar 18 2020, 2:36 PM
efriedma accepted this revision.Mar 18 2020, 3:18 PM

LGTM

llvm/test/Transforms/InstCombine/vscale_alloca.ll
25

"first"

This revision is now accepted and ready to land.Mar 18 2020, 3:18 PM
huihuiz marked 2 inline comments as done.Mar 18 2020, 8:58 PM
huihuiz added inline comments.
llvm/test/Transforms/InstCombine/vscale_alloca.ll
25

Thanks Eli! Fixed in commit patch.

This revision was automatically updated to reflect the committed changes.
huihuiz marked an inline comment as done.