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)
commita932da8f356c7f17f1fa27532e80353253482dd9
tree205da5a60cf0c481eff040b320e365d1e255e8cd
parent020ed611ff232cba28d33331be3e9e2f4c0c9539
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.

llvm-svn: 212490
llvm/lib/Transforms/Utils/SimplifyCFG.cpp
llvm/test/Transforms/SimplifyCFG/PR17073.ll [new file with mode: 0644]