mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-22 23:24:59 +00:00
use (even more) ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106744 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -112,8 +112,8 @@ unsigned InstCombiner::GetOrEnforceKnownAlignment(Value *V,
|
|||||||
}
|
}
|
||||||
|
|
||||||
Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
||||||
unsigned DstAlign = GetOrEnforceKnownAlignment(MI->getOperand(1));
|
unsigned DstAlign = GetOrEnforceKnownAlignment(MI->getArgOperand(0));
|
||||||
unsigned SrcAlign = GetOrEnforceKnownAlignment(MI->getOperand(2));
|
unsigned SrcAlign = GetOrEnforceKnownAlignment(MI->getArgOperand(1));
|
||||||
unsigned MinAlign = std::min(DstAlign, SrcAlign);
|
unsigned MinAlign = std::min(DstAlign, SrcAlign);
|
||||||
unsigned CopyAlign = MI->getAlignment();
|
unsigned CopyAlign = MI->getAlignment();
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
|||||||
|
|
||||||
// If MemCpyInst length is 1/2/4/8 bytes then replace memcpy with
|
// If MemCpyInst length is 1/2/4/8 bytes then replace memcpy with
|
||||||
// load/store.
|
// load/store.
|
||||||
ConstantInt *MemOpLength = dyn_cast<ConstantInt>(MI->getOperand(3));
|
ConstantInt *MemOpLength = dyn_cast<ConstantInt>(MI->getArgOperand(2));
|
||||||
if (MemOpLength == 0) return 0;
|
if (MemOpLength == 0) return 0;
|
||||||
|
|
||||||
// Source and destination pointer types are always "i8*" for intrinsic. See
|
// Source and destination pointer types are always "i8*" for intrinsic. See
|
||||||
@@ -140,9 +140,9 @@ Instruction *InstCombiner::SimplifyMemTransfer(MemIntrinsic *MI) {
|
|||||||
|
|
||||||
// Use an integer load+store unless we can find something better.
|
// Use an integer load+store unless we can find something better.
|
||||||
unsigned SrcAddrSp =
|
unsigned SrcAddrSp =
|
||||||
cast<PointerType>(MI->getOperand(2)->getType())->getAddressSpace();
|
cast<PointerType>(MI->getArgOperand(1)->getType())->getAddressSpace();
|
||||||
unsigned DstAddrSp =
|
unsigned DstAddrSp =
|
||||||
cast<PointerType>(MI->getOperand(1)->getType())->getAddressSpace();
|
cast<PointerType>(MI->getArgOperand(0)->getType())->getAddressSpace();
|
||||||
|
|
||||||
const IntegerType* IntType = IntegerType::get(MI->getContext(), Size<<3);
|
const IntegerType* IntType = IntegerType::get(MI->getContext(), Size<<3);
|
||||||
Type *NewSrcPtrTy = PointerType::get(IntType, SrcAddrSp);
|
Type *NewSrcPtrTy = PointerType::get(IntType, SrcAddrSp);
|
||||||
|
Reference in New Issue
Block a user