> Handle GEPs with all-zero indices in the same way we handle pointer- 
> pointer bitcasts. Also, fix a potentia infinite loop.

Nifty.

> +      while (isa<BitCastInst>(v) || isa<GetElementPtrInst>(v))
> +        if (BitCastInst* C = dyn_cast<BitCastInst>(v)) {
> +          if (isa<PointerType>(C->getSrcTy()))
> +            v = C->getOperand(0);
> +          else
> +            break;

Note that if you know the result type of a bitcast is a pointer, that  
you are guaranteed that the operand is also a pointer type, there is  
no need to check.

-Chris
_______________________________________________
llvm-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to