[PATCH] MergeFuncs should handle dynamic GEPs

Pete Cooper peter_cooper at apple.com
Mon Feb 9 13:04:48 PST 2015


Ah, sorry about that.  I forgot you were waiting on me.  I was about to ping this :)

Updated code to handle non-splat vector constants.

I actually reordered a bunch of stuff here so that we detect early if the GEPs have identical types and operands, and can just return on that case.  If that fails, we check for a DataLayout, and if we have one we do the offset checking for dynamic offsets.  If we fail to find a splat constant, then at that point we know the GEPs weren't identical so we just use their types to order them which is what would have happened in the code prior to this patch.

I added a new test case in gep2.ll which checks that 2 vector GEPs with different non-splat constants don't merge.  Before I made this fix that test would fire the assert you spotted.


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.19604.patch
Type: text/x-patch
Size: 13890 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150209/05cc8a72/attachment.bin>


More information about the llvm-commits mailing list