[PATCH] Don't constant fold bitcast/ptrtoint/inttoptr combinations without datalayout

Matt Arsenault arsenm2 at gmail.com
Tue Jul 16 18:18:01 PDT 2013


On Jul 16, 2013, at 18:02 , Eli Friedman <eli.friedman at gmail.com> wrote:
> 
> If SrcTy and MidTy have the same address-space, we know they have the
> same size; shouldn't we constant-fold even if we don't know what that
> size is?
> 

I was thinking that for a while, but the original code would only fold if the intermediate integer was at least as big as the pointer size, so this was trying to match that behavior. It could constant fold even if the middle integer size is unknown, but that would change the behavior if the middle integer was smaller (I'm not sure why you would ever want that though).



More information about the llvm-commits mailing list