[PATCH] MergeFuncs should handle dynamic GEPs

Pete Cooper peter_cooper at apple.com
Wed Jan 28 13:26:20 PST 2015

Comment at: lib/Transforms/IPO/MergeFunctions.cpp:895
@@ +894,3 @@
+      // TODO: Handle case where only one side is a struct, so long as both
+      // sides have a constant at this index, and the fielf offsets are a match.
+      if (int Res = cmpNumbers(!!StTyL, !!StTyR))
dyatkovskiy wrote:
> "fielf" => "field"
Missed that.  Thanks.

Comment at: lib/Transforms/IPO/MergeFunctions.cpp:900
@@ +899,3 @@
+      if (StTyL) {
+        unsigned IntL = cast<Constant>(OpL)->getUniqueInteger().getZExtValue();
+        unsigned IntR = cast<Constant>(OpR)->getUniqueInteger().getZExtValue();
dyatkovskiy wrote:
> May be "cast<ConstantInt>"?
I thought that too at first, but then i discovered the magic of vector GEPs.  About to upload a patch which does this the right way, i.e., we handle the scalar and vector cases.



More information about the llvm-commits mailing list