forked from OSchip/llvm-project
[SCCP] Preserve Name when converting SExt->ZExt.
This makes the output IR more readable since we're doing a one to one replacement. Reviewed By: fhahn Differential Revision: https://reviews.llvm.org/D125280
This commit is contained in:
parent
940871dd28
commit
7b362ddda9
|
@ -164,6 +164,7 @@ static bool simplifyInstsInBlock(SCCPSolver &Solver, BasicBlock &BB,
|
|||
continue;
|
||||
if (IV.getConstantRange().isAllNonNegative()) {
|
||||
auto *ZExt = new ZExtInst(ExtOp, Inst.getType(), "", &Inst);
|
||||
ZExt->takeName(&Inst);
|
||||
InsertedValues.insert(ZExt);
|
||||
Inst.replaceAllUsesWith(ZExt);
|
||||
Solver.removeLatticeValueFor(&Inst);
|
||||
|
|
Loading…
Reference in New Issue