<html dir="ltr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
</head>
<body ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">The attached patch fixes bug 12829.<br>
<br>
<a href="http://llvm.org/bugs/show_bug.cgi?id=12829" target="_blank">http://llvm.org/bugs/show_bug.cgi?id=12829</a><br>
<br>
The problem is that CriticalAntiDepBreaker rewrites a register operand of a call instruction. The comment in CriticalAntiDepBreaker::PrescanInstruction explicitly states that it is not safe to change call instructions' register operands and the piece of code
 near the end of CriticalAntiDepBreaker::PrescanInstruction sets flags in KeepRegs to prevent the register operands from being changed. The registers are changed later anyway because the flags for the clobbered registers of a register mask are cleared in CriticalAntiDepBreaker::ScanInstruction.<br>
<br>
The patch fixes this bug by moving the piece of code that sets KeepRegs in CriticalAntiDepBreaker::PrescanInstruction to CriticalAntiDepBreaker::ScanInstruction.<br>
<br>
Also, it replaces "MI->getDesc().getNumOperands()" with "MI->getNumOperands()" to have NewRC set for variable operands as well as for fixed operands.<br>
<br>
The tests that were previously failing pass after this patch is applied.<br>
</div>
</body>
</html>