When checking if a constant expression is a noop cast we fetched the
IntPtrType by doing DL->getIntPtrType(V->getType())). However, there can
be cases where V doesn't return a pointer, and then getIntPtrType()
triggers an assertion.
Now we pass DataLayout to isNoopCast so the method itself can determine
what the IntPtrType is.
This is a convoluted way to go about this. This looks like some weird API artifact from before the DataLayout was mandatory. We should change isNoopCast to take the DataLayout instead (it looks like the instruction method version already does this)