[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:
Craig Topper 2022-05-10 08:56:23 -07:00
parent 940871dd28
commit 7b362ddda9
1 changed files with 1 additions and 0 deletions

View File

@ -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);