LLVM : Remove back-edges from the loops in a function -
have unrolled loops inside file a.bc
using following command:opt -loops -loop-rotate -loop-simplify -loop-unroll -unroll-count=3 -unroll-allow-partial -debug a.bc -o a.loop.bc
now, needed remove back-edges loops inside function, f
. thought of creating llvm pass find exit block loop(assume 1 exit block) , replace back-edge edge exit block of every loop.
is there straight-forward way it?
so if not mistaken want have unique exit block loops ? if of loops have constant trip-count there not phi node @ exit blocks , rather connect them, otherwise there exit phi nodes, should reconstruct them preserve dominance property of ssa, might not straight forward, can find different methods of doing in chapter 5 of book (you can download book) : ssa book
Comments
Post a Comment