[llvm-dev] Loop Rotation in MachineBlockPlacement

Xin Tong via llvm-dev llvm-dev at lists.llvm.org
Wed Oct 4 13:08:08 PDT 2017


Hi.


I have this nested loop. When loop at Depth3 is processed, BB#193 is the
exiting block. And when loop at Depth2 is processed, the loop is rotated w.r.t
BB#193 because PreferredLoopExit is not cleared. This does not seem right
to me as BB#193 does not even exit loop at Depth2. Should not we clear
PreferredLoopExit
everytime we process a new loop ?



BB#193: derived from LLVM BB %cleanup.i.i781

    Live Ins: %RAX %RBP %RBX %RSI %R9 %R10 %R11 %R13 %R14 %R15

    Predecessors according to CFG: BB#192

        %RBX<def,tied1> = ADD64ri8 %RBX<kill,tied0>, 8,
%EFLAGS<imp-def,dead>

        %RBP<def,tied1> = ADD64ri8 %RBP<kill,tied0>, 8,
%EFLAGS<imp-def,dead>

        CMP64rr %RBX, %R15, %EFLAGS<imp-def>

        JB_1 <BB#192>, %EFLAGS<imp-use>

        JMP_1 <BB#174>

    Successors according to CFG: BB#192(0x7fef9fcb / 0x80000000 = 99.95%)
BB#174(0x00106035 / 0x80000000 = 0.05%)



Loop at depth 2 containing:
BB#191<header>,BB#192,BB#182,BB#193,BB#174,BB#175,BB#176,BB#177,BB#178,BB#179,BB#180,BB#181,BB#183,BB#187<exiting>,BB#184,BB#185,BB#186<exiting>,BB#188<exiting>,BB#189<exiting>,BB#190<latch>

Loop at depth 3 containing: BB#192<header><exiting>,BB#193<latch><exiting>



Thanks

-Xin

-- 
Software Engineer - Compiler Toolchain
Employee of Facebook Inc.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20171005/e29aecf1/attachment.html>


More information about the llvm-dev mailing list