[PR16882] Ignore noreturn definitions when setting isPhysRegUsed.
authorQuentin Colombet <qcolombet@apple.com>
Wed, 25 Sep 2013 00:26:17 +0000 (00:26 +0000)
committerQuentin Colombet <qcolombet@apple.com>
Wed, 25 Sep 2013 00:26:17 +0000 (00:26 +0000)
commitce734f1f43b3c5f614b95b53e3ed86f65daca8dd
tree4084b19bb7ef689771f4cfcc61802478ca1ab4a4
parentdfca6eec3171802d6fcb091da01604ef4420fb3b
[PR16882] Ignore noreturn definitions when setting isPhysRegUsed.

PEI inserts a save/restore sequence for the link register, according to the
information it gets from the MachineRegisterInfo.
MachineRegisterInfo is populated by the VirtRegMap pass.
This pass was not aware of noreturn calls and was registering the definitions of
these calls the same way as regular operations.

Modify VirtRegPass so that it does not set the isPhysRegUsed information for
registers only defined by noreturn calls.
The rational is that a noreturn call is the "last instruction" of the program
(if it returns the behavior is undefined), so everything that is defined by it
cannot be used and will not interfere with anything else. Therefore, it is
pointless to account for then.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191349 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/VirtRegMap.cpp
test/CodeGen/ARM/noreturn.ll [new file with mode: 0644]