[PATCH] D31924: SROA: Allow eliminating addrspacecasted allocas

Keno Fischer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 15 06:58:56 PDT 2017


loladiro added a comment.

> Do you mean non-integral pointers?

No, I don't mean non-integral pointers (though there's problems there too). I apologize if I'm being vague here, but I read a lot of architecture specs and I can never remember what is and is not public. In any case, I think the easiest example here is virtual memory. Consider an architecture with primitives for both physical and virtual memory and instructions for converting between the two quickly. It seems perfectly plausible to want to express the conversion between the two kinds of pointers as an address space cast. However, certainly geps and address space casts don't commute here. Now, as I said, you might argue that should a crazy address space cast deserves a target specific intrinsic, and I think that's a fine stance to take. I suppose the other alternative would be to add some information to the datalayout or the addressspace casts itself to indicate whether the optimizer is allowed to introduce addrspace casts that weren't in the original program.


https://reviews.llvm.org/D31924





More information about the llvm-commits mailing list