mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Have InstCombine call SipmlifyCall when handling calls. Test case included.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174675 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
#include "InstCombine.h"
|
||||
#include "llvm/ADT/Statistic.h"
|
||||
#include "llvm/Analysis/InstructionSimplify.h"
|
||||
#include "llvm/Analysis/MemoryBuiltins.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
#include "llvm/Support/CallSite.h"
|
||||
@@ -210,6 +211,11 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
||||
return &CI;
|
||||
}
|
||||
|
||||
CallSite CS(&CI);
|
||||
if (Value *V = SimplifyCall(CS.getCalledValue(), CS.arg_begin(), CS.arg_end(),
|
||||
TD))
|
||||
return ReplaceInstUsesWith(CI, V);
|
||||
|
||||
IntrinsicInst *II = dyn_cast<IntrinsicInst>(&CI);
|
||||
if (!II) return visitCallSite(&CI);
|
||||
|
||||
|
Reference in New Issue
Block a user