Check for empty YMM use-def lists in X86VZeroUpper.

The previous MRI.isPhysRegUsed(YMM0) would also return true when the
function contains a call to a function that may clobber YMM0. That's
most of them.

Checking the use-def chains allows us to skip functions that don't
explicitly mention YMM registers.

llvm-svn: 166110
This commit is contained in:
Jakob Stoklund Olesen 2012-10-17 17:52:35 +00:00
parent 086da34119
commit a10c09804d
1 changed files with 1 additions and 1 deletions

View File

@ -147,7 +147,7 @@ bool VZeroUpperInserter::runOnMachineFunction(MachineFunction &MF) {
const TargetRegisterClass *RC = &X86::VR256RegClass;
for (TargetRegisterClass::iterator i = RC->begin(), e = RC->end();
i != e; i++) {
if (MRI.isPhysRegUsed(*i)) {
if (!MRI.reg_nodbg_empty(*i)) {
YMMUsed = true;
break;
}