[InstCombine] Fix worklist management in rewriteGEPAsOffset() more thoroughly
authorNikita Popov <npopov@redhat.com>
Thu, 1 Jun 2023 08:58:58 +0000 (10:58 +0200)
committerNikita Popov <npopov@redhat.com>
Thu, 1 Jun 2023 09:00:49 +0000 (11:00 +0200)
commitb9e328fd9113327f3d5c775f367cc3f4bc2f080f
tree7af1b0ad23b01d82f7986cb78733c3c2c9020f06
parentb7e110fcfe22a1f887507dbaa6fdb001630e223d
[InstCombine] Fix worklist management in rewriteGEPAsOffset() more thoroughly

We need to add the replaced instruction itself to the worklist as
well. We want to remove the old instructions, but can't easily do
so directly, as the icmp is also one of the users and we need to
retain it until the fold has finished.
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp