<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>Hello, </div>
<div><br>
</div>
<div>While looking at some internal benchmarks, I found that llvm generates codes with redundant promotion, something like:</div>
<div><br>
</div>
<div>xor %al, %cl</div>
<div>movzbl %cl, %ecx</div>
<div>cmp $0x20, %ecx</div>
<div><br>
</div>
<div>I believe that the promotion stems from the logic in X86TargetLowering::EmitCmp. Comments in the code says, </div>
<div><br>
</div>
<div>"Do the comparison at i32 if it's smaller, besides the Atom case. This avoids subregister aliasing issues. Keep the smaller reference if we're optimizing for size, however, as that'll allow better folding of memory operations."</div>
<div><br>
</div>
<div>Can anybody please explain me more in detail about the subregister aliasing issues?</div>
<div><br>
</div>
<div>Thanks,</div>
<div>Taewook</div>
</div>
</body>
</html>