[OpenMP][FIX] Properly check assume only uses
authorJohannes Doerfert <johannes@jdoerfert.de>
Tue, 31 Jan 2023 11:33:49 +0000 (03:33 -0800)
committerJohannes Doerfert <johannes@jdoerfert.de>
Tue, 31 Jan 2023 14:13:54 +0000 (06:13 -0800)
commita51ad873bfc9f3ccf7971efce4c5f0a543ee3d5a
tree7f2e5a4cfc0e10a9e5b76690e1fd86e0939f7b69
parente098ee726eff11f680149122511d2883cb50e8d2
[OpenMP][FIX] Properly check assume only uses

We improved our simplification and this exposed a bug in the store
elimination. A load that had dead uses and assume uses was thought to be
used by assumes only. Consequently we also deleted the "dead use users".
This was a problem because a dead use just means we will not use the
load there. The user might still be needed.

Exposed by OvO, reported by @ye-luo.
llvm/lib/Transforms/IPO/AttributorAttributes.cpp
llvm/test/Transforms/Attributor/value-simplify-assume.ll
llvm/test/Transforms/Attributor/value-simplify-pointer-info.ll