The problem is passing in something that isn't a pointer that you didn't mean to. Generally doing whatever it takes to convert types isn't desirable. If you're expecting to get a pointer-only cast like addrspacecast, you probably don't want an integer to be passed in. http://llvm-reviews.chandlerc.com/D2205