Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoopReroll incorrectly reorders memory instrs when there is overlap #47002

Closed
llvmbot opened this issue Sep 27, 2020 · 2 comments
Closed

LoopReroll incorrectly reorders memory instrs when there is overlap #47002

llvmbot opened this issue Sep 27, 2020 · 2 comments
Labels

Comments

@llvmbot
Copy link
Collaborator

llvmbot commented Sep 27, 2020

Bugzilla Link 47658
Version trunk
OS All
Reporter LLVM Bugzilla Contributor
CC @efriedma-quic,@hfinkel,@jmolloy,@zhengyang92,@nunoplopes,@regehr

Extended Description

Test: Transforms/LoopReroll/basic.ll
Function: pointer_bitcast_baseinst
Reason: Memory mismatch

Example: https://godbolt.org/z/5c8YK1
Ordering of loads and stores with memory offsets:

source - load 876, load 892, store 892, store 900, ...
target - load 876, store 892, load 892, store 900, ...

Since there is overlap between the memory positions of the second load and first store in source then the swapped ordering of these instructions in target is incorrect.
This optimization should not be performed in case of such a memory overlap.

A detailed and complete Alive report with single iteration loop unroll on this test can be seen here: https://pastebin.com/pQsf61wb

@nunoplopes
Copy link
Member

Here's a manually unrolled report from Alive2: https://alive2.llvm.org/ce/z/tmuXZ_

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
@nikic
Copy link
Contributor

nikic commented Feb 10, 2024

The LoopReroll pass has been removed by #80972.

@nikic nikic closed this as not planned Won't fix, can't repro, duplicate, stale Feb 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants