<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#ffffff">
LLVMers,<br>
<br>
I have a traversal plan which needs to visit certain types of
Functions. For each instruction in such functions, I will need to
know:<br>
1. is it located inside a loop<br>
2. if yes, what level of loop nest it is currently in.<br>
<br>
So on the highest level, it should be a FunctionPass. However, in
order to identify loops and loop-nest levels, it should also be a
LoopPass.<br>
<br>
Is there a reasonably simple way to identify loop(s) within a
function under FunctionPass?<br>
<br>
(Any existing LLVM code that I can take a look?)<br>
<br>
<font color="#cc0000">OR</font><br>
<br>
Is it possible to intermix different types of LLVM Passes?<br>
<br>
E.g.<br>
<br>
class MyPass: public FunctionPass, public LoopPass{<br>
...<br>
public:<br>
bool runOnFunction(...);<br>
bool runOnLoop(...);<br>
...<br>
};<br>
<br>
Does this make any sense?<br>
I haven't seem to find any existing LLVM pass under such uses.<br>
<br>
<br>
Thank you very much<br>
<br>
Chuck<br>
<br>
</body>
</html>