mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-26 20:26:07 +00:00
Teach InstCombineLoadCast about address spaces.
This is another one that doesn't matter much, but uses the right GEP index types in the first place. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189854 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -304,8 +304,8 @@ static Instruction *InstCombineLoadCast(InstCombiner &IC, LoadInst &LI,
|
||||
if (Constant *CSrc = dyn_cast<Constant>(CastOp))
|
||||
if (ASrcTy->getNumElements() != 0) {
|
||||
Type *IdxTy = TD
|
||||
? TD->getIntPtrType(LI.getContext())
|
||||
: Type::getInt64Ty(LI.getContext());
|
||||
? TD->getIntPtrType(SrcTy)
|
||||
: Type::getInt64Ty(SrcTy->getContext());
|
||||
Value *Idx = Constant::getNullValue(IdxTy);
|
||||
Value *Idxs[2] = { Idx, Idx };
|
||||
CastOp = ConstantExpr::getGetElementPtr(CSrc, Idxs);
|
||||
|
Reference in New Issue
Block a user