[SCCP] Replace new value's value state with removed value's
authorluxufan <luxufan@iscas.ac.cn>
Sat, 10 Jun 2023 07:48:09 +0000 (15:48 +0800)
committerluxufanxport https_proxy=http://127.0.0.1:1080 <luxufan@iscas.ac.cn>
Mon, 12 Jun 2023 03:40:47 +0000 (11:40 +0800)
commitcf79773a9006a7e22f3919268b7db381ddcb3abc
tree26e8978c991a1e09675354818ec8659356b08ac4
parent4c7ae4ad31c5e89afc42e734bee3048111777ec3
[SCCP] Replace new value's value state with removed value's

In replaceSignedInst, if a signed instruction can be repalced with
unsigned instruction, we created a new instruction and removed the old
instruction's value state. If the following instructions has this new
instruction as a use operand, transformations like replaceSignedInst and
refineInstruction would be blocked. The reason is there is no value
state for the new instrution.

This patch set the new instruction's value state with the removed
instruction's value state. I believe it is correct bacause when we
repalce a signed instruction with unsigned instruction, the value state
is not changed.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D152337
llvm/include/llvm/Transforms/Utils/SCCPSolver.h
llvm/lib/Transforms/IPO/SCCP.cpp
llvm/lib/Transforms/Scalar/SCCP.cpp
llvm/lib/Transforms/Utils/SCCPSolver.cpp
llvm/test/Transforms/SCCP/add-nuw-nsw-flags.ll
llvm/test/Transforms/SCCP/ip-ranges-sext.ll