[PATCH] D37762: [InstCombine] Remove single use restriction from InstCombine's explicit sinking code.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 12 13:25:44 PDT 2017


craig.topper created this revision.

The explicit sinking code in InstCombine checks to make sure the candidate for sinking only has a single use. But that doesn't really make sense. All that should really matter is that all uses are in the same basic block.

The test case is derived from a real example I saw in a benchmark we where ended up with a chain of conditional ORs that we were unable to sink completely because %select1 has two uses in the successor block.

I fear based on other discussions on the mailing list that this patch may be controversial because InstCombine shouldn't really be doing this sinking at all. But I'm just trying to make it logical until such time that a new sinking pass is implemented.


https://reviews.llvm.org/D37762

Files:
  lib/Transforms/InstCombine/InstCombineInternal.h
  lib/Transforms/InstCombine/InstructionCombining.cpp
  test/Transforms/InstCombine/sink_instruction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D37762.114889.patch
Type: text/x-patch
Size: 6699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170912/2529ad95/attachment.bin>


More information about the llvm-commits mailing list