[llvm-commits] [llvm] r130272 - in /llvm/trunk: lib/Target/X86/X86FastISel.cpp test/CodeGen/X86/fast-isel-i1.ll

Duncan Sands baldrick at free.fr
Tue Apr 26 23:51:48 PDT 2011


Hi Eli,

> +  // Note that i1 essentially gets ANY_EXTEND'ed to i8 where it isn't used
> +  // in an explicit cast, so make sure to handle that correctly.

I don't understand this comment.  An i1 branch condition is zero extended to
i8 by the type legalizer on x86.

Ciao, Duncan.

>     unsigned OpReg = getRegForValue(BI->getCondition());
>     if (OpReg == 0) return false;
>
> -  BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TEST8rr))
> -    .addReg(OpReg).addReg(OpReg);
> +  BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::TEST8ri))
> +    .addReg(OpReg).addImm(1);
>     BuildMI(*FuncInfo.MBB, FuncInfo.InsertPt, DL, TII.get(X86::JNE_4))
>       .addMBB(TrueMBB);
>     FastEmitBranch(FalseMBB, DL);



More information about the llvm-commits mailing list