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

    <tr>
        <th>Summary</th>
        <td>
            IR Outliner: Instruction does not dominate all uses!
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            llvm:crash,
            llvm:optimizations
      </td>
    </tr>

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

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

<pre>
    When compiling sqlite3 for AArch64 at -O3 using the IR outliner we get

```
Instruction does not dominate all uses!
  %5 = load i32, i32* %rc5, align 4, !tbaa !89
  %13 = phi i32 [ %5, %sqlite3ValueNew.exit.thread.i ], [ %5, %if.then.i50 ]
Instruction does not dominate all uses!
  %5 = load i32, i32* %rc5, align 4, !tbaa !89
  %13 = phi i32 [ %5, %sqlite3ValueNew.exit.thread.i ], [ %5, %if.then.i50 ]
in function outlined_ir_func_7
```

Bugpointed testcase available here: https://godbolt.org/z/s1EascTMW

CC @AndrewLitteken 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzlU01v1DAQ_TXJZdTIieNt95BD2qVSJaASQvS4cuJJYvDGiz1pob-ecXarFsSBO5Lj8XjevMyXO29-Ng8TztD7w9E6O48QvztLKGHwAdo29NOmBk1wcS9hiQlAE8LdJ_ALMR4DPCGMSJnYZaI97xtxXqt6N0cKS0_Wz2A8Rpg98eFgZ00I2jkmxphV5QkOkFVKQSZ34Lw2YGWVVTcn0SZb6FW60M6OM9TpyL7UaZ3k1fYNSylXmuNkkztk6nrlPrmoc6ZftFvwIz4V-MNSQVNAbQrL4N2K-93HDozAubBKrIj_I0E7w7DMpwTPfTd7G_bpcn_516af9utlPHo7ExogjNTryPV41NbpziFMGDCTLUxEx8iHrLrlNXrTeUeFDyNrz_zF8p2O_ecPD2-pbzjcWrSzCfj03hLhNx7j3DTSbOVW52TJYcNzen-e0_Sjf25UvgTX_BGWpWnpCn4orDj3-CIujsF_xZ5YtTEuyf1W1bUU-dT0fS02pVGXm7KssRPYl91gOrOtK3mFss-5Duhiwz3IqmollW0fdJxYPTXk5dYfyR7ss06xx2RVu9w2lagqIcsrocqNkkVZ4jBIUQ9SSSVQcIHwwNUuEkkqaB6aNeZuGSMbnY0UX406Rp44xDUe5tcLTT40PnB5dL5m16yp_QLPakQk">