Add the cold attribute to error-reporting call sites
authorHal Finkel <hfinkel@anl.gov>
Sun, 17 Nov 2013 02:06:35 +0000 (02:06 +0000)
committerHal Finkel <hfinkel@anl.gov>
Sun, 17 Nov 2013 02:06:35 +0000 (02:06 +0000)
commit390564206f67b742ad7cbee1cf17ae52efa77cb6
treeec0316c2a2513a18e1a2ad3fc6d49e1618f0eda5
parentbb756ca24401e190e3b704e5d92759c7a79cc6b7
Add the cold attribute to error-reporting call sites

Generally speaking, control flow paths with error reporting calls are cold.
So far, error reporting calls are calls to perror and calls to fprintf,
fwrite, etc. with stderr as the stream. This can be extended in the future.

The primary motivation is to improve block placement (the cold attribute
affects the static branch prediction heuristics).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194943 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/err-rep-cold.ll [new file with mode: 0644]