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)
commit743b1940846b242e1cdb50d3fc0c6e8fa8dfbf0a
tree434157e0be71d291d6031737acb1b610b240cf8a
parenta3635b7b3bca60cd5c901b33bb023363c2bcd0ae
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.

llvm-svn: 186067
llvm/lib/CodeGen/RegisterScavenging.cpp
llvm/test/CodeGen/PowerPC/rs-undef-use.ll [new file with mode: 0644]