<div dir="ltr"><div><div><div><div><div><div><div><div><div>Hi, LLVM, <br><br></div>I found LLVM codegen has 3 passes for instruction scheduling:<br><br></div>1) pre-ra sched<br></div>2) post-ra sched<br></div>3) mi sched. <br>
<br></div>for RISC machines, there are data hazard cases appear only after Register Allocation(RA).  for example, $t0 is used immediately after writing(RAW):<br></div><br>ld $t0, MEM<br></div>add $t2, $t0, $0<br><br></div>
There may be one or more stall in pipeline. Instruction scheduler can detect this kinds of conflict and insert other instructions to avoid pipeline bubble. I think this work only can be done after RA.  If so, what's the purpose for 1). I found 1) is mandatory  and 2/3) are optional.  Further, at least one target enable pre-RA-sched with harzardRecognizer. Does it really work out? you can resolve data hazard using pre-RA-sched only? <br>
<br>thanks,<br></div><div>--lx<br><br></div><div><br></div><div><br><br><div><div><div><div><br><div><div><div><div><div><div><div><br></div></div></div></div></div></div></div></div></div></div></div></div></div>