LLVM OPT not giving optimised file as output.
问题 The man page for opt says: "It takes LLVM source files as input, runs the specified optimizations or analyses on it, and then outputs the optimized file or the analysis results". My Goal: To use the inbuilt optimisation pass -dce available in opt . This pass does Dead Code Elimination My Source file foo.c : int foo(void) { int a = 24; int b = 25; /* Assignment to dead variable -- dead code */ int c; c = a * 4; return c; } Here is what I did: 1. clang-7.0 -S -emit-llvm foo.c -o foo.ll 2. opt