[PATCH] D16302: [opaque pointer types] [NFC] Take advantage of get{Source, Result}ElementType when folding GEPs.
Eduard Burtescu via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 21 15:35:17 PST 2016
eddyb added inline comments.
================
Comment at: lib/Analysis/ConstantFolding.cpp:739
@@ +738,3 @@
+
+ if (Constant *C = CastGEPIndices(SrcElemTy, Ops, ResTy, DL, TLI))
+ return C;
----------------
dblaikie wrote:
> How/why did this get rolled in here?
I had two calls to `SymbolicallyEvaluateGEP` at some point and it was easier to have it here than two `CastGEPIndices` at each site.
IMO `CastGEPIndices` shouldn't bother creating a GEP ConstantExpression but rather change what `Ops` in this function points to (if any indices were cast).
http://reviews.llvm.org/D16302
More information about the llvm-commits
mailing list