[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)
commit71d7b18e3d7e81f707caab1e35d5e211c96a941c
tree7c438f415cd64808c111cdc476ff73d3b30c1af0
parent7af6af4225e5c3354d8c2857dacef9af4eb4ab59
[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.

llvm-svn: 225895
llvm/include/llvm/Transforms/Utils/SimplifyLibCalls.h
llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
llvm/test/Transforms/InstCombine/memcpy_chk-1.ll