================
@@ -2282,6 +2282,15 @@ Instruction 
*InstCombinerImpl::visitGetElementPtrInst(GetElementPtrInst &GEP) {
   if (MadeChange)
     return &GEP;
 
+  // Canonicalize constant GEPs to i8 type.
----------------
nikic wrote:

GEP operates in terms of bytes, not bits. The size of i8 is required to be 1. 
GEP doesn't care how the mapping from size to size in bits looks like. So if 
you want to map i8 to 32 bits, then that should be fine as far as GEP/ptradd 
are concerned (though of course breaks all kinds of other assumptions).

https://github.com/llvm/llvm-project/pull/68882
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to