[InstCombine] call SimplifyICmpInst with correct context
authorJingyue Wu <jingyue@google.com>
Thu, 25 Jun 2015 20:14:47 +0000 (20:14 +0000)
committerJingyue Wu <jingyue@google.com>
Thu, 25 Jun 2015 20:14:47 +0000 (20:14 +0000)
commit529f49db93c039b0ea7ec7c8ad9b5067cd8e7e78
treef75ab81935ed99d907c12ebe1738a9bfc8289412
parent1de6f369b3e17580ae2d61bc88fc5a3c54ccdae1
[InstCombine] call SimplifyICmpInst with correct context

Summary:
Fixes PR23809. Without passing the context to SimplifyICmpInst, we would
use the assume to prove that the condition feeding the assume is
trivially true (see isValidAssumeForContext in ValueTracking.cpp),
causing the removal of the assume which may be useful for later
optimizations.

Test Plan: pr23800.ll

Reviewers: hfinkel, majnemer

Reviewed By: hfinkel

Subscribers: henryhu, llvm-commits, wengxt, broune, meheff, eliben

Differential Revision: http://reviews.llvm.org/D10695

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@240683 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/pr23809.ll [new file with mode: 0644]