Skip to content

Please merge c2dafe12dc24f7f1326f5c4c6a3b23f1485f1bd6 into release/10.x#56

Merged
tstellar merged 1 commit intorelease/10.xfrom
issue-56-pr
Apr 16, 2020
Merged

Please merge c2dafe12dc24f7f1326f5c4c6a3b23f1485f1bd6 into release/10.x#56
tstellar merged 1 commit intorelease/10.xfrom
issue-56-pr

Conversation

@tstellar
Copy link
Owner

@tstellar tstellar commented Apr 9, 2020

@tstellar
Copy link
Owner Author

tstellar commented Apr 9, 2020

cherry-pick: c2dafe1

@github-actions
Copy link

github-actions bot commented Apr 9, 2020

branch: issue-56-pr

SimplifyCFG should not merge empty return blocks and leave a CallBr behind
with a duplicated destination since the verifier will then trigger an
assert. This patch checks for this case and avoids the transformation.

CodeGenPrepare has a similar check which also has a FIXME comment about why
this is needed. It seems perhaps better if these two passes would eventually
instead update the CallBr instruction instead of just checking and avoiding.

This fixes https://bugs.llvm.org/show_bug.cgi?id=45062.

Review: Craig Topper

Differential Revision: https://reviews.llvm.org/D75620

(cherry picked from commit c2dafe1)
@tstellar tstellar merged commit a610554 into release/10.x Apr 16, 2020
tstellar pushed a commit that referenced this pull request Aug 27, 2024
)

Currently, process of replacing bitwise operations consisting of
`LSR`/`LSL` with `And` is performed by `DAGCombiner`.

However, in certain cases, the `AND` generated by this process
can be removed.

Consider following case:
```
        lsr x8, x8, #56
        and x8, x8, #0xfc
        ldr w0, [x2, x8]
        ret
```

In this case, we can remove the `AND` by changing the target of `LDR`
to `[X2, X8, LSL #2]` and right-shifting amount change to 56 to 58.

after changed:
```
        lsr x8, x8, #58
        ldr w0, [x2, x8, lsl #2]
        ret
```

This patch checks to see if the `SHIFTING` + `AND` operation on load
target can be optimized and optimizes it if it can.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants