[PATCH] [AArch64] Improve and enable the SeparateConstOffsetFromGEP for AArch64 backend.

hfinkel at anl.gov hfinkel at anl.gov
Thu Oct 23 13:28:31 PDT 2014


This generally looks good to me. It would be good to have someone expert in this pass to also look it over.

> the performance test has not finished yet. But the assembly code looks similar to the old patch for cortex-a57. If the result is better than the old patch, I'll remove the logic about transformation to ptrtoint/inttoptr. 

I am curious how this turns out; please let us know.

================
Comment at: lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:86
@@ +85,3 @@
+//
+// Even we can extract constant from GEPs, sometimes it is still unable to do
+// fully CSE for complex GEPs. There are two reasons:
----------------
Even we can extract constant from GEPs -> Even if we can extract constants from GEPs

================
Comment at: lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:88
@@ +87,3 @@
+// fully CSE for complex GEPs. There are two reasons:
+// (1) The above algrithm can not extract constant in struct type indices.
+// Actually the indices of struct types in GEP are always constant which can
----------------
algorithm

================
Comment at: lib/Transforms/Scalar/SeparateConstOffsetFromGEP.cpp:984
@@ +983,3 @@
+          if (ElementSize.isPowerOf2())
+            Idx = Builder.CreateShl(
+                Idx, ConstantInt::get(IntPtrTy, ElementSize.logBase2()));
----------------
I think that if the original GEP has the "inbounds" property, then the shl, mul here (and the same below plus the add in the ptrtoint/inttoptr code) can have the nsw/nuw flags.

http://reviews.llvm.org/D5864






More information about the llvm-commits mailing list