[GVN][NFC] Remove redundant check
authorksyx <18738953+ksyx@users.noreply.github.com>
Sat, 13 Nov 2021 20:59:43 +0000 (15:59 -0500)
committerksyx <18738953+ksyx@users.noreply.github.com>
Sat, 20 Nov 2021 01:24:36 +0000 (20:24 -0500)
commit97b9e8438e269a999969b08d4efe20c3d71013ca
treec78d4f84a5169c9017ac13380175db2ed9218cf0
parent1bd4dc4f2854edf3035732416ec7e4adbddaf982
[GVN][NFC] Remove redundant check

The if-check above deleted part guarantees that StoreOffset <= LoadOffset
and that StoreOffset + StoreSize >= LoadOffset + LoadSize, and given that
LoadOffset + LoadSize > LoadOffset when LoadSize > 0. Thus, this shows
StoreOffset + StoreSize > LoadOffset is guaranteed given LoadSize > 0,
while it could be meaningless to have a type with nonpositive size, so that
the check could be removed. The values are converted to signed types to
avoid unsigned operation with negative offsets.

Part of revision D100179
Reapply commit c35e8185d8c170c20e28956e0c9f3c1be895fefb with fixing problem
reported by mstorsjo
llvm/lib/Transforms/Utils/VNCoercion.cpp