<div dir="ltr"><div><div><div><div><div>Hello,<br><br></div>I am a beginner in LLVM development with the aim of writing a new optimization pass. But then before I could do that, I thought of writing simple passes. I could successfully implement the Hello pass as given in the doc. Then I wrote a simple Constant Folding pass - evaluate instructions of the form c=10+20 and replace all uses of c with 30. Only later did I realize that Clang does this optimization while building the IR. Hence I couldn't check whether my constant folding pass is "working". I have two questions:<br>

<br></div>1. Is there a way to disable constant folding during IR development by clang?<br></div>2. If not, can someone suggest a simple optimization (simple in complexity on the lines of constant folding) to get started?<br>

<br></div>My intention is to get used to the APIs in LLVM and not get cluttered by the optimization itself. (Hence I chose constant folding in the first place.)<br><br></div><div>Any opinion will be appreciated :)<br><br>

</div>Regards,<br><div><div><div><div><div><div>Rekha
</div></div></div></div></div></div></div>