[CodeGen] Use pointer-sized integers for ptrtoint sources
Given something like: void *v = (void *)100; We need to synthesize a ptrtoint operation from 100. During constant emission, we choose i64 as the type for our constant because it guaranteed not to drop any bits from our CharUnits representation of the value. However, this is suboptimal for 32-bit targets: LLVM passes like GlobalOpt will get confused by these sorts of casts resulting in pessimization. Instead, make sure the ptrtoint operand has a pointer-sized integer type. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@273020 91177308-0d34-0410-b5e6-96231b3b80d8
Loading
Please register or sign in to comment