LICM may hoist an instruction with undefined behavior above a trap.
authorNadav Rotem <nrotem@apple.com>
Tue, 4 Sep 2012 10:25:04 +0000 (10:25 +0000)
committerNadav Rotem <nrotem@apple.com>
Tue, 4 Sep 2012 10:25:04 +0000 (10:25 +0000)
commit7765492a7a7e6eab36bc43558ea7c1f91e57cfec
tree9c5cb82bd89c30a288cc00c830e1e1b74969f93d
parent68d92bdcc99e647546f40cfce5cfbeb904be2985
LICM may hoist an instruction with undefined behavior above a trap.

Scan the body of the loop and find instructions that may trap.
Use this information when deciding if it is safe to hoist or sink instructions.
Notice that we can optimize the search of instructions that may throw in the case of nested loops.

rdar://11518836

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163132 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/LICM.cpp
test/Transforms/LICM/hoisting.ll