<div dir="ltr"><span style="font-size:13.1999998092651px;line-height:19.7999992370605px">Given the program:</span><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><div>int sum(int i,int j)</div><div>{ return i+j; }</div><div><br></div><div>int main()</div><div>{ sum(3,2); }</div></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">$ clang -S -emit-llvm foo.c<br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">Now I'd like to print all statistics. Unfortunately, the following prints nothing:</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">$ opt -S -O3 -stats < foo.ll > /dev/null<br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">However, running the following prints an IR that is different to the contents of foo.ll:</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">$ opt -S -O3 foo.ll<br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">I'm using LLVM 3.5. <span style="font-size:13.1999998092651px">I'm doing something very obviously wrong. What is it?</span></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px"><br></div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">--</div><div style="font-size:13.1999998092651px;line-height:19.7999992370605px">Rob</div></div>