[InstCombine] Allow sinking from unique predecessor with multiple edges
authorJun Bum Lim <junbuml@codeaurora.org>
Mon, 22 Aug 2016 18:21:56 +0000 (18:21 +0000)
committerJun Bum Lim <junbuml@codeaurora.org>
Mon, 22 Aug 2016 18:21:56 +0000 (18:21 +0000)
commitec8b8cc5954ac0c7c0ce0a4074cf87488431b980
treebb04a4cfab65aca787b542a92962881e739fbb4e
parent475f4a763f9a051f5769099dcf49ac858d4c6272
[InstCombine] Allow sinking from unique predecessor with multiple edges

Summary: We can allow sinking if the single user block has only one unique predecessor, regardless of the number of edges. Note that a switch statement with multiple cases can have the same destination.

Reviewers: mcrosier, majnemer, spatel, reames

Subscribers: reames, mcrosier, llvm-commits

Differential Revision: https://reviews.llvm.org/D23722

llvm-svn: 279448
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/sink_instruction.ll