[InstCombine] Erase old mul when creating umulo
authorNikita Popov <nikita.ppv@gmail.com>
Sun, 29 Mar 2020 17:20:11 +0000 (19:20 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sun, 29 Mar 2020 18:46:08 +0000 (20:46 +0200)
commit8253a86b65c626f470e90ddacba1166b81012b12
tree6ecd0c854f6f5aefa74cc1544651af6b46590438
parent53d209076aa877e4e40edaaf3614f33285e1851b
[InstCombine] Erase old mul when creating umulo

As we don't return the result of replaceInstUsesWith(), we are
responsible for erasing the instruction.

There is a small subtlety here in that we need to do this after
the other uses of Builder, which uses the original multiply as
the insertion point.

NFC apart from worklist order changes.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp