In the expander why do you call getIntPtrType without the address space? Is this supposed to provide a type wide enough for all address spaces? The getIntPtrType API comment suggests this should be avoided. Otherwise, LGTM. http://llvm-reviews.chandlerc.com/D1449