[SimplifyLibCalls] Don't try to simplify indirect calls.
authorAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 14 Jan 2015 00:55:05 +0000 (00:55 +0000)
committerAhmed Bougacha <ahmed.bougacha@gmail.com>
Wed, 14 Jan 2015 00:55:05 +0000 (00:55 +0000)
commit61d6dc41fac11d6ff1923ca0f7c34c09e5a70285
tree2418eda97bfdcfd36f2840084a45c721a5a377fa
parent7e73dc4ef9894c009a5e62af4f0ad4b0209cf208
[SimplifyLibCalls] Don't try to simplify indirect calls.

It turns out, all callsites of the simplifier are guarded by a check for
CallInst::getCalledFunction (i.e., to make sure the callee is direct).

This check wasn't done when trying to further optimize a simplified fortified
libcall, introduced by a refactoring in r225640.

Fix that, add a testcase, and document the requirement.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@225895 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Transforms/Utils/SimplifyLibCalls.h
lib/Transforms/Utils/SimplifyLibCalls.cpp
test/Transforms/InstCombine/memcpy_chk-1.ll