[all-commits] [llvm/llvm-project] 97b9e8: [GVN][NFC] Remove redundant check

ksyx via All-commits all-commits at lists.llvm.org
Fri Nov 19 17:26:00 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 97b9e8438e269a999969b08d4efe20c3d71013ca
      https://github.com/llvm/llvm-project/commit/97b9e8438e269a999969b08d4efe20c3d71013ca
  Author: ksyx <18738953+ksyx at users.noreply.github.com>
  Date:   2021-11-19 (Fri, 19 Nov 2021)

  Changed paths:
    M llvm/lib/Transforms/Utils/VNCoercion.cpp

  Log Message:
  -----------
  [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




More information about the All-commits mailing list