mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
[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
This commit is contained in:
@@ -46,6 +46,7 @@ public:
|
||||
/// \brief Take the given call instruction and return a more
|
||||
/// optimal value to replace the instruction with or 0 if a more
|
||||
/// optimal form can't be found.
|
||||
/// The call must not be an indirect call.
|
||||
Value *optimizeCall(CallInst *CI);
|
||||
|
||||
private:
|
||||
@@ -83,6 +84,7 @@ public:
|
||||
/// be equal to the instruction being optimized. In this case all
|
||||
/// other instructions that use the given instruction were modified
|
||||
/// and the given instruction is dead.
|
||||
/// The call must not be an indirect call.
|
||||
Value *optimizeCall(CallInst *CI);
|
||||
|
||||
/// replaceAllUsesWith - This method is used when the library call
|
||||
|
Reference in New Issue
Block a user