[PowerPC] Don't use a non-allocatable register to implement the 'cc' alias
authorHal Finkel <hfinkel@anl.gov>
Mon, 8 Dec 2014 22:54:22 +0000 (22:54 +0000)
committerHal Finkel <hfinkel@anl.gov>
Mon, 8 Dec 2014 22:54:22 +0000 (22:54 +0000)
commitaa10b3caaf813ba9e4a26ee73a1586022e98d258
tree0813c26840fcd945e7a1cf758d1e8d03b7fe47b8
parenta15a6dc78e46163bf10aa28fe05cb646a6d23b6e
[PowerPC] Don't use a non-allocatable register to implement the 'cc' alias

GCC accepts 'cc' as an alias for 'cr0', and we need to do the same when
processing inline asm constraints. This had previously been implemented using a
non-allocatable register, named 'cc', that was listed as an alias of 'cr0', but
the infrastructure does not seem to support this properly (neither the register
allocator nor the scheduler properly accounts for the alias). Instead, we can
just process this as a naming alias inside of the inline asm
constraint-processing code, so we'll do that instead.

There are two regression tests, one where the post-RA scheduler did the wrong
thing with the non-allocatable alias, and one where the register allocator did
the wrong thing. Fixes PR21742.

llvm-svn: 223708
llvm/lib/Target/PowerPC/PPCISelLowering.cpp
llvm/lib/Target/PowerPC/PPCRegisterInfo.td
llvm/test/CodeGen/PowerPC/subreg-postra-2.ll [new file with mode: 0644]
llvm/test/CodeGen/PowerPC/subreg-postra.ll [new file with mode: 0644]