Fix for PR20059 (instcombine reorders shufflevector after instruction that may trap)
authorSanjay Patel <spatel@rotateright.com>
Wed, 9 Jul 2014 16:34:54 +0000 (16:34 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 9 Jul 2014 16:34:54 +0000 (16:34 +0000)
commit296cb7b128114eda207f96c65513335efe46a1d5
tree9251508370989a168ba6c4e305d710b6294d62d8
parent6a6556695e2e3c983a95d6dd78d601f857b861ab
Fix for PR20059 (instcombine reorders shufflevector after instruction that may trap)

In PR20059 ( http://llvm.org/pr20059 ), instcombine eliminates shuffles that are necessary before performing an operation that can trap (srem).

This patch calls isSafeToSpeculativelyExecute() and bails out of the optimization in SimplifyVectorOp() if needed.

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

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