OSDN Git Service

[InstCombine] only allow narrow/wide evaluation of values with >1 use if that user...
authorSanjay Patel <spatel@rotateright.com>
Mon, 5 Feb 2018 17:16:50 +0000 (17:16 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 5 Feb 2018 17:16:50 +0000 (17:16 +0000)
commit16748767563bb9bcb1e1c3e42c35d44924d464d0
treea222f2b3aeb6a4695be76e34948a070821dced8e
parent6661a9b542a19ac8e4f024f4015efe6cec2e3c37
[InstCombine] only allow narrow/wide evaluation of values with >1 use if that user is a binop

There was a logic hole in D42739 / rL324014 because we're not accounting for select and phi
instructions that might have repeated operands. This is likely a source of an infinite loop.
I haven't manufactured a test case to prove that, but it should be safe to speculatively limit
this transform to binops while we try to create that test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@324252 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCasts.cpp