[PATCH] D14596: [SROA] Choose more profitable type in findCommonType

David Li via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 9 12:35:08 PST 2015


davidxl added a comment.

There are other heuristics that can be applied here:

1. recognize the load/store pattern generated from lowered memcpy and 'ignore' use types from them if there are other use types;
2. Go deeper in the use type analysis -- instead of stopping at the load instruction -- follow the DU chain to find the real use-type of the expanded values (as in arithmetic operations)


================
Comment at: lib/Transforms/Scalar/SROA.cpp:1105
@@ +1104,3 @@
+    if (UserTy)
+      ++TypeCounters[UserTy];
+  }
----------------
Counting the number of static occurrences is not the best way IMO. Why not using profile/frequency information of the uses?


http://reviews.llvm.org/D14596





More information about the llvm-commits mailing list