mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-07 11:33:44 +00:00
Simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64164 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b1032a8a2f
commit
65b52dffe0
@ -2699,12 +2699,13 @@ void SelectionDAGLowering::visitGetElementPtr(User &I) {
|
||||
if (CI->getZExtValue() == 0) continue;
|
||||
uint64_t Offs =
|
||||
TD->getTypePaddedSize(Ty)*cast<ConstantInt>(CI)->getSExtValue();
|
||||
SDValue OffsVal = DAG.getConstant(Offs, MVT::i64);
|
||||
SDValue OffsVal;
|
||||
unsigned PtrBits = TLI.getPointerTy().getSizeInBits();
|
||||
if (PtrBits < 64)
|
||||
OffsVal = DAG.getNode(ISD::TRUNCATE, getCurDebugLoc(),
|
||||
TLI.getPointerTy(), OffsVal);
|
||||
else
|
||||
if (PtrBits < 64) {
|
||||
OffsVal = DAG.getNode(ISD::TRUNCATE, getCurDebugLoc(),
|
||||
TLI.getPointerTy(),
|
||||
DAG.getConstant(Offs, MVT::i64));
|
||||
} else
|
||||
OffsVal = DAG.getIntPtrConstant(Offs);
|
||||
N = DAG.getNode(ISD::ADD, getCurDebugLoc(), N.getValueType(), N,
|
||||
OffsVal);
|
||||
|
Loading…
Reference in New Issue
Block a user