Check multiple register classes for inline asm tied registers
authorHal Finkel <hfinkel@anl.gov>
Tue, 18 Dec 2012 17:50:58 +0000 (17:50 +0000)
committerHal Finkel <hfinkel@anl.gov>
Tue, 18 Dec 2012 17:50:58 +0000 (17:50 +0000)
commitca2dd36c395f5ead63572d45a2106b9d34d8ca90
tree2a974890da559c45f9ecdc5c212d6dc9ba051f5e
parent04b116e08eefe1ddd4a719889f136c624ee5914e
Check multiple register classes for inline asm tied registers

A register can be associated with several distinct register classes.
For example, on PPC, the floating point registers are each associated with
both F4RC (which holds f32) and F8RC (which holds f64). As a result, this code
would fail when provided with a floating point register and an f64 operand
because it would happen to find the register in the F4RC class first and
return that. From the F4RC class, SDAG would extract f32 as the register
type and then assert because of the invalid implied conversion between
the f64 value and the f32 register.

Instead, search all register classes. If a register class containing the
the requested register has the requested type, then return that register
class. Otherwise, as before, return the first register class found that
contains the requested register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170436 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/TargetLowering.cpp
test/CodeGen/PowerPC/in-asm-f64-reg.ll [new file with mode: 0644]