mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
Change this to work with renamed intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26484 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -5286,7 +5286,13 @@ Instruction *InstCombiner::visitCallInst(CallInst &CI) {
|
|||||||
if (GlobalVariable *GVSrc = dyn_cast<GlobalVariable>(MMI->getSource()))
|
if (GlobalVariable *GVSrc = dyn_cast<GlobalVariable>(MMI->getSource()))
|
||||||
if (GVSrc->isConstant()) {
|
if (GVSrc->isConstant()) {
|
||||||
Module *M = CI.getParent()->getParent()->getParent();
|
Module *M = CI.getParent()->getParent()->getParent();
|
||||||
Function *MemCpy = M->getOrInsertFunction("llvm.memcpy",
|
const char *Name;
|
||||||
|
if (CI.getCalledFunction()->getFunctionType()->getParamType(3) ==
|
||||||
|
Type::UIntTy)
|
||||||
|
Name = "llvm.memcpy.i32";
|
||||||
|
else
|
||||||
|
Name = "llvm.memcpy.i64";
|
||||||
|
Function *MemCpy = M->getOrInsertFunction(Name,
|
||||||
CI.getCalledFunction()->getFunctionType());
|
CI.getCalledFunction()->getFunctionType());
|
||||||
CI.setOperand(0, MemCpy);
|
CI.setOperand(0, MemCpy);
|
||||||
Changed = true;
|
Changed = true;
|
||||||
|
Reference in New Issue
Block a user