[PATCH] D19075: mergefunc: avoid merge with loop metadata

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 13 14:26:48 PDT 2016


jfb created this revision.
jfb added reviewers: hfinkel, rengolin.
jfb added a subscriber: llvm-commits.
Herald added a subscriber: jfb.

Loop metadata hints at unrolling and vectorization. mergefunc shouldn't merge
when they're different since someone expressed the wish for the functions to
differ (yes we could also ignore metadata, but let's not be mean). This can
happen when running mergefunc 'early' (right after clang or another frontend
generates code) but shouldn't happen when running it 'late' (after optimizations
are run and loop metadata has been put to use).

This inadvertently happens in test/Transforms/LoopVectorize/X86/metadata-enable.ll

This patch doesn't fix all of mergefunc's handling of metadata, it simply makes
one case less broken and puts us closer to being able to use mergefunc.

http://reviews.llvm.org/D19075

Files:
  lib/Transforms/IPO/MergeFunctions.cpp
  test/Transforms/MergeFunc/loop-metadata-different.ll
  test/Transforms/MergeFunc/loop-metadata-one-missing.ll
  test/Transforms/MergeFunc/loop-metadata-same.ll
  test/Transforms/MergeFunc/loop-metadata-self-ref.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19075.53621.patch
Type: text/x-patch
Size: 13825 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160413/55d6a9e3/attachment.bin>


More information about the llvm-commits mailing list