<meta http-equiv="content-type" content="text/html; charset=utf-8"><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 13px; border-collapse: collapse; ">Thanks for your last reply.<br>Could I understand the way to <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">adding</span> <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span> (built into the llvm rather than<br>
dynamic loadable) includes:<br>1. Declaring <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> creator function for this <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span><br>
2. Implementing the creator function for this <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span><br>
3. Instantiating this <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span> and get <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> object of it<br>
3. Register this <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span> into the PassRegistry<br>
<br>Then, for <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> built-into bytecode <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span>,<br>
task 1(declaration of the creator) should be done in Scalar.h;<br> task 2(implementation of the creator) should be done the related<br>mypass.cpp file;<br> task 3(instantiation of the <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span> class) should be done in<br>
LinkAllPasses.h;<br> task 4(registration of the <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span> into the PassRegistry) should be<br>
done by INITIALIZE_PASS<br>class LiveVariables : public MachineFunctionPass is <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> case of point.<br>
<br>For <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> built-into codegen/MachineCode <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">pass</span>,<br>
task 1 should be done in Passes.h;<br> task 2 should be done in the related mypass.cpp file;<br> task 3 should be done in LLVMTargetMachine.cpp<br> task 4 should be done by INITIALIZE_PASS<br>
class IntervalAnalylsis: public MachineFunctionPass is <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> case in point.<br>
<br>I have implemented <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> new mypass (just for analysis, rather than<br>
transformation) as <span class="il" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(255, 255, 136); color: rgb(34, 34, 34); background-position: initial initial; background-repeat: initial initial; ">a</span> subclass of MchineFunctionPass, and finished task 1, 2,<br>
4. But I don't know how to finish task 3, since I failed to make clear how<br>the class IntervalAnalysis did task 3. So I need your help.<br></span><br>-- <br>Best regards,<div><br></div><div>Li Qingan</div><br>