]> granicus.if.org Git - llvm/commit
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.
authorAlexey Bataev <a.bataev@hotmail.com>
Tue, 12 Dec 2017 17:19:15 +0000 (17:19 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Tue, 12 Dec 2017 17:19:15 +0000 (17:19 +0000)
commitbe064aa777cc55c7532ccd51f5c80a843aac5e0b
tree3c329525826a05f8dff4c28250cd41b69df27423
parent52966dce46c4a8f632044efdd2a917f5da3ecf9e
[InstCombine] Fix PR35618: Instcombine hangs on single minmax load bitcast.

Summary:
If we have pattern `store (load(bitcast(select (cmp(V1, V2), &V1,
&V2)))), bitcast)`, but the load is used in other instructions, it leads
to looping in InstCombiner. Patch adds additional check that all users
of the load instructions are stores and then replaces all uses of load
instruction by the new one with new type.

Reviewers: RKSimon, spatel, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320499 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
test/Transforms/InstCombine/multiple-uses-load-bitcast-select.ll [new file with mode: 0644]