<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/60348>60348</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [opt] Can I use opt to implement passes of O1 without vectorization and loop unrolling?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          zzhang77
      </td>
    </tr>
</table>

<pre>
    Currently, I am trying to mimic the O1 process of flang using opt, because I would like to disable some passes (vectorization passes and loop unrolling) and I didn't find -fno-vectorization or -fno-unroll-loops in flang-new. Opt might be possible to implement O1 process without those passes.

I tried something like this
`flang-new -O0 test.f90 -S -o test.ll `

`opt -sroa -early-cse -simplifycfg -instcombine -libcalls-shrinkwrap -simplifycfg -reassociate -loop-instsimplify -loop-simplifycfg -licm -loop-rotate -licm -simple-loop-unswitch -bdce -instcombine -simplifycfg -instcombine test.ll -S -o test-after.ll `
Those passes are got from buildO1FunctionSimplificationPipeline of llvm/lib/Passes/PassBuilderPipelines.cpp. 

But I'm not sure whether it is done correctly.
Any suggestions are welcomed. Thanks!
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx0VN-Oo7wPfZr0xgLR0Jbhgov5o0q9mpV2XyAEA_lNiFFstuo8_U-B9tuZ1ffdVMWxT86xfWKY3RAQG3V8Uce3nVlkpNh8fo4mDFW1a6m7Na9LjBjE35R-hQuYCSTeXBhACCY3OQsyIrzvYY5kkRmoh96bMMDCKY1mSZUtWrMwwgWutPgOvPvABNE5Nq1HYJoQZsOMDEo__UYrFN2nEUfhETehA080wxIiee_CoHS9Ri_QuS4oXQn0LnSQ9YGy7xgUt-hWmyUcBhc2rlnAaw7vs8DkhlGgRZiJ2SVmQuCm2eOEQb7qvDoZaRGQkfhBPVfFmyqet98LSHTYrdJkTL3YRI-O72mn4p_bIXsvQJAl7-sCsp-Q0fbpPahT8RVXnQqaBTKOZCBDE_0ts4yQceLp-pvtB8hcYLE0tS4gZN611njPGY_RhY9rNPNf6RENM1lnJKUTzSvAI-Ue-lbhnZ3u8Uiy1a2hNQu3kyXw1YkdIWs7i3-x-k--D-F_2pCZXjB-a8avL30HExEGEugjTdAuznfv-_MSbBr9z-0aZ9dF-OFm9OkS6sH735PSZ-9apc8_VqT7n5cEgfGRzLmd5xy-TuFlEbgoXU0QSICXiHAdUUaM4AQcQ0cBwVKMaMXf7pvxHG7AyzAgJy4b7yt6SxN2OfwaTfhgpfe7rim7uqzNDpv9qTo8VVVd1buxQbPXukSjjzV21tSHtu7s_lSXh8rWpuh3rtGFLou9firKoz4-5ceyaw-mqvblscDjoVOHAifjfJ7E5xSHnWNesDkV5eFp502LntcHQeu0luuh0jq9D7FJNVm7DKwOhXcs_AdFnPj1JUmGP77BqwlwgWT5tKzfTHSfGfXJTg8bfXfrv1i9PO-W6JtRZGZVPit9Vvo8OBmXNre0zvE-zkRyjvQ_tKL0eVWQ5roq_H8AAAD__0InssQ">