[PATCH] fix for PR17073 (simplifycfg hoists an operation that can trap)

Sanjay Patel spatel at rotateright.com
Mon Jul 7 09:40:01 PDT 2014


Hi hfinkel,

In PR17073 ( http://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.

http://reviews.llvm.org/D4408

Files:
  lib/Transforms/Utils/SimplifyCFG.cpp
  test/Transforms/SimplifyCFG/PR17073.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D4408.11120.patch
Type: text/x-patch
Size: 5113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140707/334e4671/attachment.bin>


More information about the llvm-commits mailing list