]> granicus.if.org Git - llvm/commit
[GlobalISel] Replace all combined G_EXTRACT uses.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 1 Mar 2017 00:43:39 +0000 (00:43 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 1 Mar 2017 00:43:39 +0000 (00:43 +0000)
commit7fdaba3e0f887b747f3face7bdc72ed09ea4d720
tree12043fff910f6dd277146bcb25f1d2ae8cafff57
parent12246fec03787fe72cdef35ae2b7f07012d46160
[GlobalISel] Replace all combined G_EXTRACT uses.

Iterating on the use-list we're modifying doesn't work: after the first
iteration, the use-list iterator will point to a MachineOperand
referencing the new register.  This caused us to skip the other uses to
replace.

Instead, use MRI.replaceRegWith(), which accounts for this behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@296551 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/GlobalISel/Legalizer.cpp
test/CodeGen/AArch64/GlobalISel/legalize-combines.mir