diff options
| author | Jakub Kuderski <kubak@google.com> | 2019-12-18 14:55:41 -0500 |
|---|---|---|
| committer | Jakub Kuderski <kubak@google.com> | 2019-12-18 14:55:41 -0500 |
| commit | 3d29c41ad59e2e783da43a8b30a3f4f2d0c78a72 (patch) | |
| tree | d80729db4584c5e0751de81202ccf1020bcd59fb /lldb/packages/Python/lldbsuite/support/__init__.py | |
| parent | 11d5fa6e87e3584f72056ecc2b17f88c58323dde (diff) | |
| download | bcm5719-llvm-3d29c41ad59e2e783da43a8b30a3f4f2d0c78a72.tar.gz bcm5719-llvm-3d29c41ad59e2e783da43a8b30a3f4f2d0c78a72.zip | |
[InstCombine] Insert instructions before adding them to worklist
Summary:
This patch adds instructions to the InstCombine worklist after they are properly inserted. This way we don't get `<badref>`s printed when logging added instructions.
It also adds a check in `Worklist::Add` that ensures that all added instructions have parents.
Simple test case that illustrates the difference when run with `--debug-only=instcombine`:
```
define i32 @test35(i32 %a, i32 %b) {
%1 = or i32 %a, 1135
%2 = or i32 %1, %b
ret i32 %2
}
```
Before this patch:
```
INSTCOMBINE ITERATION #1 on test35
IC: ADDING: 3 instrs to worklist
IC: Visiting: %1 = or i32 %a, 1135
IC: Visiting: %2 = or i32 %1, %b
IC: ADD: %2 = or i32 %a, %b
IC: Old = %3 = or i32 %1, %b
New = <badref> = or i32 %2, 1135
IC: ADD: <badref> = or i32 %2, 1135
...
```
With this patch:
```
INSTCOMBINE ITERATION #1 on test35
IC: ADDING: 3 instrs to worklist
IC: Visiting: %1 = or i32 %a, 1135
IC: Visiting: %2 = or i32 %1, %b
IC: ADD: %2 = or i32 %a, %b
IC: Old = %3 = or i32 %1, %b
New = <badref> = or i32 %2, 1135
IC: ADD: %3 = or i32 %2, 1135
...
```
Reviewers: fhahn, davide, spatel, foad, grosser, nikic
Reviewed By: nikic
Subscribers: nikic, lebedev.ri, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71093
Diffstat (limited to 'lldb/packages/Python/lldbsuite/support/__init__.py')
0 files changed, 0 insertions, 0 deletions

