LLVM Bugzilla is read-only and represents the historical archive of all LLVM issues filled before November 26, 2021. Use github to submit LLVM bugs

Bug 46460 - [DSE] Stores not eliminated if they are overwritten in a loop.
Summary: [DSE] Stores not eliminated if they are overwritten in a loop.
Status: NEW
Alias: None
Product: libraries
Classification: Unclassified
Component: Scalar Optimizations (show other bugs)
Version: trunk
Hardware: PC All
: P enhancement
Assignee: Unassigned LLVM Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-06-25 09:18 PDT by Florian Hahn
Modified: 2021-09-09 09:03 PDT (History)
3 users (show)

See Also:
Fixed By Commit(s):


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Hahn 2020-06-25 09:18:43 PDT
In the example below, LLVM currently does not eliminate the stores in the second loop, even though the second loop exactly overwrites the stores of the first loop. Similarly the first loop could be replaced by a memcpy and we still not remove it:

https://godbolt.org/z/kGBEXS


void init(int *P, unsigned N) {
   for (unsigned i = 0; i < N; i++)
        P[i] = 1;

    for (unsigned i = 0; i < N; i++)
        P[i] = 1;
}
Comment 1 Daniil Seredkin 2021-09-09 09:03:45 PDT
I work on a first patch to implement optimization with memory intrinsics https://reviews.llvm.org/D109280