RegScavenger should not exclude undef uses
authorHal Finkel <hfinkel@anl.gov>
Thu, 11 Jul 2013 05:55:57 +0000 (05:55 +0000)
committerHal Finkel <hfinkel@anl.gov>
Thu, 11 Jul 2013 05:55:57 +0000 (05:55 +0000)
commit838a7fb1a3bc514f062a44565f6680b7aeee6a87
treeb3ef0e128bae99eb9bd4f3a12228167160595774
parent2ebba647eab05aaf71f6a309f855720ab6f90c7f
RegScavenger should not exclude undef uses

When computing currently-live registers, the register scavenger excludes undef
uses. As a result, undef uses are ignored when computing the restore points of
registers spilled into the emergency slots. While the register scavenger
normally excludes from consideration, when scavenging, registers used by the
current instruction, we need to not exclude undef uses. Otherwise, we might end
up requiring more emergency spill slots than we have (in the case where the
undef use *is* the currently-spilled register).

Another bug found by llvm-stress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186067 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/RegisterScavenging.cpp
test/CodeGen/PowerPC/rs-undef-use.ll [new file with mode: 0644]