[llvm-commits] CAST patch: #3: lib/Transforms (except instcombine)

Reid Spencer rspencer at reidspencer.com
Mon Nov 20 23:40:06 PST 2006


Some questions ..

On Mon, 2006-11-20 at 14:48 -0800, Chris Lattner wrote:

> 
> @@ -1173,11 +1172,11 @@ static void ShrinkGlobalToBoolean(Global
>  
> 
> 
>        std::string Name = LI->getName(); LI->setName("");
>        LoadInst *NLI = new LoadInst(NewGV, Name+".b", LI);
>        Value *NSI;
>        if (IsOneZero)
> -        NSI = new CastInst(NLI, LI->getType(), Name, LI);
> +        NSI = CastInst::getCast(NLI, LI->getType(), Name, LI);
>        else
>          NSI = new SelectInst(NLI, OtherVal, InitVal, Name, LI);
> 
> 
> This cast is always a zext, please be explicit.

What if LI->getType() is BoolTy? You can't ZExt Bool to Bool.

Reid




More information about the llvm-commits mailing list