Don't generate llvm.expect intrinsics with -O0.
authorPete Cooper <peter_cooper@apple.com>
Mon, 26 Jan 2015 20:51:58 +0000 (20:51 +0000)
committerPete Cooper <peter_cooper@apple.com>
Mon, 26 Jan 2015 20:51:58 +0000 (20:51 +0000)
commitf051cbf6313251ce07b89cd35bf674118d833d7e
tree7df62e1714bee5bec95d8824f22f9cfb952ecdda
parent0dc86722f55adfd0e311066ca627626de999ca2d
Don't generate llvm.expect intrinsics with -O0.

The backend won't run LowerExpect on -O0.  In a debug LTO build, this results in llvm.expect intrinsics being in the LTO IR which doesn't know how to optimize them.

Thanks to Chandler for the suggestion and review.

Differential revision: http://reviews.llvm.org/D7183

llvm-svn: 227135
clang/lib/CodeGen/CGBuiltin.cpp
clang/test/CodeGen/builtin-expect.c