mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-29 11:17:28 +00:00
[InstCombine] Erase original add when creating saddo
Usually when we replaceInstUsesWith() we also return the original instruction, and InstCombine will take care of erasing it. Here we don't do that, so we need to manually erase it. NFC apart from worklist order changes.
This commit is contained in:
parent
1e363023b8
commit
6f07a9e80a
@ -1330,6 +1330,7 @@ static Instruction *processUGT_ADDCST_ADD(ICmpInst &I, Value *A, Value *B,
|
||||
// The inner add was the result of the narrow add, zero extended to the
|
||||
// wider type. Replace it with the result computed by the intrinsic.
|
||||
IC.replaceInstUsesWith(*OrigAdd, ZExt);
|
||||
IC.eraseInstFromFunction(*OrigAdd);
|
||||
|
||||
// The original icmp gets replaced with the overflow value.
|
||||
return ExtractValueInst::Create(Call, 1, "sadd.overflow");
|
||||
|
Loading…
Reference in New Issue
Block a user