opt options

What exactly are the standard compile options that are implemented when
using -std-compile-opts?

The reason I'm asking is it seems that -std-compile-opts creates some
CFG graphs that are invalid and should not be created and I am trying to
figure out which stage is creating this issue?

The input LLVM-ir is in test.ll.

The version with no optimizations looks correct, but the one using
-std-compile-opts produces a CFG with an infinite loop.

Micah Villmow

Systems Engineer

Advanced Technology & Performance

Advanced Micro Devices Inc.

4555 Great America Pkwy,

Santa Clara, CA. 95054

P: 408-572-6219

F: 408-572-6596

test.ll (2 KB)

no_opt_test_fc_while_continue_or.dot (941 Bytes)

opt_test_fc_while_continue_or.dot (1 KB)

$ opt -debug-pass=Arguments -std-compile-opts
to see a list of passes.

You might want to try bugpoint; see
http://llvm.org/docs/HowToSubmitABug.html and
http://llvm.org/docs/Bugpoint.html for more info. For your specific
case, you'll need to add a "main" of some sort, and pass something
like -timeout 2 so that it doesn't take forever. That said, it's a
lot more convenient than doing a manual binary search.


Ok, will do, I found the pass that was causing it, -loop-unswitch. I'll
get a test case and a bug file.

The input LLVM-ir is in test.ll.

If you make your testcase executable, bugpoint
can find the problematic pass for you and produce
a minimal testcase. Two for the price of one :slight_smile: