[llvm-commits] [llvm] r123565 - /llvm/trunk/lib/Transforms/InstCombine/InstructionCombining.cpp

Frits van Bommel fvbommel at gmail.com
Sun Jan 16 01:14:48 PST 2011


On Sun, Jan 16, 2011 at 6:08 AM, Chris Lattner <sabre at nondot.org> wrote:
>       Value *TrueVInPred = TrueV->DoPHITranslation(PhiTransBB, ThisBB);
>       Value *FalseVInPred = FalseV->DoPHITranslation(PhiTransBB, ThisBB);
>       Value *InV = 0;
> -      if (Constant *InC = dyn_cast<Constant>(PN->getIncomingValue(i))) {
> +      if (Constant *InC = dyn_cast<Constant>(PN->getIncomingValue(i)))
>         InV = InC->isNullValue() ? FalseVInPred : TrueVInPred;
> -      } else {
> -        assert(PN->getIncomingBlock(i) == NonConstBB);
> -        InV = SelectInst::Create(PN->getIncomingValue(i), TrueVInPred,
> -                                 FalseVInPred,
> -                                 "phitmp", NonConstBB->getTerminator());
> -        Worklist.Add(cast<Instruction>(InV));
> -      }
> +      else
> +        InV = Builder->CreateSelect(PN->getIncomingValue(i),
> +                                    TrueVInPred, FalseVInPred, "phitmp");

This "manual constant folding" is no longer necessary, the IRBuilder
should handle it. Occurs all over this revision.




More information about the llvm-commits mailing list