[StackColoring] Don't merge slots with differing StackIDs
authorFraser Cormack <fraser@codeplay.com>
Mon, 16 May 2022 15:38:52 +0000 (16:38 +0100)
committerFraser Cormack <fraser@codeplay.com>
Tue, 17 May 2022 07:28:49 +0000 (08:28 +0100)
commit599ff247dee8f462638731c3b2fdd3d1e332a2fe
treecdc556e6fe840ace3fbf1e88dd27883180266554
parenta694546f7cdf6fbcacddf229eeff5316e4bd0eae
[StackColoring] Don't merge slots with differing StackIDs

The documentation for this specifically mentions that this should not
happen. We could think about adding target hooks to permit it (and how
to merge IDs) in the future if that is desirable.

This specific test case was merging a scalable-vector slot into a
non-scalable one and dropping the notion of scalability, meaning we
failed to allocate enough stack space for the object.

Reviewed By: arsenm, MaskRay, sdesmalen

Differential Revision: https://reviews.llvm.org/D125699
llvm/lib/CodeGen/StackColoring.cpp
llvm/test/CodeGen/RISCV/rvv/stack-coloring-scalablevec.mir [new file with mode: 0644]