1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 19:12:56 +02:00

Use COPY for fast-isel bitconvert, but don't create cross-class copies.

This doesn't change the behavior of SelectBitcast for X86.

llvm-svn: 108073
This commit is contained in:
Jakob Stoklund Olesen 2010-07-11 05:16:54 +00:00
parent 84716579d4
commit e2f74d400c

View File

@ -671,13 +671,12 @@ bool FastISel::SelectBitCast(const User *I) {
if (SrcVT.getSimpleVT() == DstVT.getSimpleVT()) {
TargetRegisterClass* SrcClass = TLI.getRegClassFor(SrcVT);
TargetRegisterClass* DstClass = TLI.getRegClassFor(DstVT);
ResultReg = createResultReg(DstClass);
bool InsertedCopy = TII.copyRegToReg(*FuncInfo.MBB, FuncInfo.InsertPt,
ResultReg, Op0,
DstClass, SrcClass, DL);
if (!InsertedCopy)
ResultReg = 0;
// Don't attempt a cross-class copy. It will likely fail.
if (SrcClass == DstClass) {
ResultReg = createResultReg(DstClass);
BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(TargetOpcode::COPY),
ResultReg).addReg(Op0);
}
}
// If the reg-reg copy failed, select a BIT_CONVERT opcode.