[PATCH] D152337: [SCCP] Replace new value's value state with removed value's

luxufan via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 6 22:00:04 PDT 2023


StephenFan created this revision.
StephenFan added reviewers: nikic, fhahn.
Herald added subscribers: snehasish, ormris, hiraditya.
Herald added a project: All.
StephenFan requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D152337

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152337.529155.patch
Type: text/x-patch
Size: 8836 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/01d3f481/attachment.bin>


More information about the llvm-commits mailing list