[LLVMdev] clang -O2 versus opt -O2 | llc | clang

Tim Northover t.p.northover at gmail.com
Fri May 23 12:22:55 PDT 2014


Hi Sanjay,

> I'm investigating a miscompilation bug (
> http://llvm.org/bugs/show_bug.cgi?id=19823 ), but I've run into a problem:
> the output of the program is different when I compile the IR with clang
> compared to opt | llc | clang. Any clues on how to resolve this difference?

>From the bug, it looks like there might be a problem with loop
unrolling. Running "opt -loop-unroll -unroll-runtime" on its own
performs the dodgy transformation and changes the output.

I've not tracked down quite how Clang sets that extra
"-unroll-runtime" option (I'd be interested to know myself, actually,
having failed).

Cheers.

Tim.



More information about the llvm-dev mailing list