<div dir="ltr"><div><div><div>We've recently moved our project from LLVM 3.6 to LLVM 3.9.  I noticed  one of our code generation tests is breaking in 3.9.<br><br></div>The test is:<br><br> ; RUN: llc < %s -march=xstg | FileCheck %s<br><br>define i64 @bclr64(i64 %a, i64 %b) nounwind readnone {<br>entry:<br>; CHECK: bclr     r1, r0, r1, 64<br>  %sub = sub i64 %b, 1<br>  %shl = shl i64 1, %sub<br>  %xor = xor i64 %shl, -1<br>  %and = and i64 %a, %xor<br>  ret i64 %and<br>}<br><br></div>I ran llc with -debug to get a better idea of what's going on and found:<br><br>Initial selection DAG: BB#0 'bclr64:entry'<br>SelectionDAG has 14 nodes:<br>  t0: ch = EntryToken<br>      t2: i64,ch = CopyFromReg t0, Register:i64 %vreg0<br>            t4: i64,ch = CopyFromReg t0, Register:i64 %vreg1<br>          t6: i64 = sub t4, Constant:i64<1><br>        t7: i64 = shl Constant:i64<1>, t6<br>      t9: i64 = xor t7, Constant:i64<-1><br>    t10: i64 = and t2, t9<br>  t12: ch,glue = CopyToReg t0, Register:i64 %R1, t10<br>  t13: ch = XSTGISD::Ret t12, Register:i64 %R1, t12:1<br><br><br><br>Combining: t13: ch = XSTGISD::Ret t12, Register:i64 %R1, t12:1<br><br>Combining: t12: ch,glue = CopyToReg t0, Register:i64 %R1, t10<br><br>Combining: t11: i64 = Register %R1<br><br>Combining: t10: i64 = and t2, t9<br><br>Combining: t9: i64 = xor t7, Constant:i64<-1><br> ... into: t15: i64 = rotl Constant:i64<-2>, t6<br><br>Combining: t10: i64 = and t2, t15<br><br>Combining: t15: i64 = rotl Constant:i64<-2>, t6<br><br>Combining: t14: i64 = Constant<-2><br><br>Combining: t6: i64 = sub t4, Constant:i64<1><br> ... into: t17: i64 = add t4, Constant:i64<-1><br><br>Combining: t15: i64 = rotl Constant:i64<-2>, t17<br><br><br><br></div><div>These rotl instructions weren't showing up when I ran llc 3.6 and that's completely changing the generated code at the end which means the test fails (and it's less optimal than it was in 3.6). <br><br>I've been looking in the LLVM language docs (3.9 version) and I don't see any documentation on 'rotl'. What does it do? Why isn't it in the docs?<br><br></div><div>Phil<br></div></div>