[MergeICmps] Ignore clobbering instructions before the loads
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 26 Aug 2021 19:23:58 +0000 (21:23 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 27 Aug 2021 21:31:35 +0000 (23:31 +0200)
commit757409da7a69f3b0ab23687642dc5edf2061bc51
tree60975704e0d5a63d3a04e8200fe64c1afd8fe36b
parent696e7905a142a2c422c6b1485857c900dbdd14fb
[MergeICmps] Ignore clobbering instructions before the loads

This is another followup to D106591. Even if there is an
instruction that clobbers one of the loads, this doesn't matter if
it happens before the loads. Those instructions aren't affected by
the transform at all.

The gep-references-bb.ll is modified to preserve the spirit of the
test, as the store to @g no longer impacts the transform.

Differential Revision: https://reviews.llvm.org/D108782
llvm/lib/Transforms/Scalar/MergeICmps.cpp
llvm/test/Transforms/MergeICmps/X86/gep-references-bb.ll
llvm/test/Transforms/MergeICmps/X86/split-block-does-work.ll