title: LLVM OPT not giving optimised file as output.
body: <p>The man page for <code>opt</code> 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". <br></p>
  
  <p>My Goal: To use the inbuilt optimisation pass <code>-dce</code> available in <code>opt</code>. This pass does <code>Dead Code Elimination</code> <br></p>
  
  <p>My Source file <code>foo.c</code>: </p>
  
  <pre><code>int foo(void)
   {
     int a = 24;
     int b = 25; /* Assignment to dead variable -- dead code */
     int c;
     c = a * 4;
     return c;
  }
  </code></pre>
  
  <p>Here is what I did: <br>
  1. <code>clang-7.0 -S -emit-llvm foo.c -o foo.ll</code> <br>
  2. <code>opt -dce -S foo.ll -o fooOpt.ll</code><br></p>
  
  <p><strong>What I expect</strong> : A .ll file in which the dead code (in source code with the comment) part is eliminated.<br></p>
  
  <p><strong>What I get</strong>: fooOpt.ll is the same as non optimised code foo.ll</p>
  
  <p>I have already seen <a href="https://stackoverflow.com/questions/29758987/using-llvm-opt-with-built-in-passes">this</a> SO answer, but I didn't get optimised code. <br>
  Am I missing something here? Can someone please guide me on the right path.<br>
  Thank you.</p>