Fix for PR17073 ( http://llvm.org/pr17073 ), simplifycfg illegally hoists an operatio...
authorSanjay Patel <spatel@rotateright.com>
Mon, 7 Jul 2014 21:19:00 +0000 (21:19 +0000)
committerSanjay Patel <spatel@rotateright.com>
Mon, 7 Jul 2014 21:19:00 +0000 (21:19 +0000)
commit80c193dec7cca361a473c6aa3484321d69cc90d3
treeb140366ae0f2a5ed92e2407fc2aa61594b1453c6
parentb6b12e59a263e3eb984505921352195e38ecddde
Fix for PR17073 ( llvm.org/pr17073 ), simplifycfg illegally hoists an operation in a phi node that can trap.

This patch adds to an existing loop over phi nodes in SimplifyCondBranchToCondBranch() to check for trapping ops and bails out of the optimization if we find one of those.

The test cases verify that trapping ops are not hoisted and non-trapping ops are still optimized as expected.

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