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)
commit58814445d4a43d9ab8a2adba5309d6affd378101
treeec454fefef2405c02bd6e3fb6470c8f7e4b1a8e6
parentdf734cdd39cd3ad90f4f4466ddb497ffc14c1258
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

llvm-svn: 212629
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
llvm/test/Transforms/InstCombine/pr20059.ll [new file with mode: 0644]