[InstCombine] Use replaceOperand() API in GEP transforms
authorNikita Popov <nikita.ppv@gmail.com>
Sat, 28 Mar 2020 18:02:48 +0000 (19:02 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 28 Mar 2020 18:07:25 +0000 (19:07 +0100)
commit30d712103faa8c78e8b1dbc9cc6c9b831bb20e4c
tree1360e85cd4031622d2a0411b3e51c403ea7463c2
parentb1f78baeaa1aadba8ab8e5b0ba102cec146a16fd
[InstCombine] Use replaceOperand() API in GEP transforms

To make sure that replaced operands get DCEd. This drops one
iteration from gepphigep.ll, which is still not optimal.

This was the last test case performing more than 3 iterations.

NFC-ish, only worklist order should change.
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/gepphigep.ll