[RegAllocFast] Scan physcial reg definitions before assigning virtual reg definitions
authorQuentin Colombet <quentin.colombet@gmail.com>
Wed, 8 May 2019 18:30:26 +0000 (18:30 +0000)
committerQuentin Colombet <quentin.colombet@gmail.com>
Wed, 8 May 2019 18:30:26 +0000 (18:30 +0000)
commit157427245a1993870870629dd36eb978add90570
treed2e2b1cd0c23e60c32543998eef2be96b5bd6331
parent9820d04dbcbaba1eeab72be2b436a95074e2a952
[RegAllocFast] Scan physcial reg definitions before assigning virtual reg definitions

When assigning the definitions of an instruction we were updating
the available registers while walking the definitions. Some of
those definitions may be from physical registers and thus, they are
not available for other definitions to take, but by the time we see
that we may have already assign these registers to another
virtual register.

Fix that by walking through all the definitions and mark as unavailable
the physical register definitions, then do the virtual register assignments.

PR41790

llvm-svn: 360278
llvm/lib/CodeGen/RegAllocFast.cpp
llvm/test/CodeGen/X86/virtreg-physreg-def-regallocfast.mir [new file with mode: 0644]