[PATCH] MergeFuncs should handle dynamic GEPs

Pete Cooper peter_cooper at apple.com
Sun Jan 25 23:19:23 PST 2015


When compiling std::vector<float> and std::vector<int>, both get a function called push_back_slow_path.  This function could be merged except that one does float[i] and the other int[i].  These are identical given that int and float have the same size and alignment.

This patch teaches MergeFunctions about dynamic GEPs, which must return the same offset given 'index * element size' for both LHS and RHS.

This reduces the size of an LTO'd llc by almost 1.5%.

http://reviews.llvm.org/D7170

Files:
  lib/Transforms/IPO/MergeFunctions.cpp
  test/Transforms/MergeFunc/gep.ll
  test/Transforms/MergeFunc/gep2.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D7170.18742.patch
Type: text/x-patch
Size: 8012 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150126/058b7989/attachment.bin>


More information about the llvm-commits mailing list