aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineInstr.cpp
diff options
context:
space:
mode:
authorWhitney Tsang <whitney.uwaterloo@gmail.com>2019-06-05 20:42:47 +0000
committerWhitney Tsang <whitney.uwaterloo@gmail.com>2019-06-05 20:42:47 +0000
commit2d0896c1cb90243f12df698e84458016c0c121dc (patch)
treefea8cd28304fcf9f378affb062f91d71d384e921 /llvm/lib/CodeGen/MachineInstr.cpp
parent8d7f118ab2b9e51d6cf2811291e319b4d977eb8c (diff)
downloadllvm-2d0896c1cb90243f12df698e84458016c0c121dc.zip
llvm-2d0896c1cb90243f12df698e84458016c0c121dc.tar.gz
llvm-2d0896c1cb90243f12df698e84458016c0c121dc.tar.bz2
[LOOPINFO] Extend Loop object to add utilities to get the loop bounds,
step, and loop induction variable. Summary: This PR extends the loop object with more utilities to get loop bounds, step, and loop induction variable. There already exists passes which try to obtain the loop induction variable in their own pass, e.g. loop interchange. It would be useful to have a common area to get these information. /// Example: /// for (int i = lb; i < ub; i+=step) /// <loop body> /// --- pseudo LLVMIR --- /// beforeloop: /// guardcmp = (lb < ub) /// if (guardcmp) goto preheader; else goto afterloop /// preheader: /// loop: /// i1 = phi[{lb, preheader}, {i2, latch}] /// <loop body> /// i2 = i1 + step /// latch: /// cmp = (i2 < ub) /// if (cmp) goto loop /// exit: /// afterloop: /// /// getBounds /// getInitialIVValue --> lb /// getStepInst --> i2 = i1 + step /// getStepValue --> step /// getFinalIVValue --> ub /// getCanonicalPredicate --> '<' /// getDirection --> Increasing /// getInductionVariable --> i1 /// getAuxiliaryInductionVariable --> {i1} /// isCanonical --> false Reviewers: kbarton, hfinkel, dmgreen, Meinersbur, jdoerfert, syzaara, fhahn Reviewed By: kbarton Subscribers: tvvikram, bmahjour, etiotto, fhahn, jsji, hiraditya, llvm-commits Tag: LLVM Differential Revision: https://reviews.llvm.org/D60565 llvm-svn: 362644
Diffstat (limited to 'llvm/lib/CodeGen/MachineInstr.cpp')
0 files changed, 0 insertions, 0 deletions