diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2013-08-26 15:06:10 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2013-08-26 15:06:10 +0000 |
commit | edd08f74289c6ba3b3f8e730e4ab825ef9bd6492 (patch) | |
tree | cf3037b11ce6827bd2a1c3398d9e4c6b8b12b5a7 /lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | |
parent | d08a9303614355cfdcac5f2c27c09ce809565423 (diff) | |
download | llvm-edd08f74289c6ba3b3f8e730e4ab825ef9bd6492.tar.gz llvm-edd08f74289c6ba3b3f8e730e4ab825ef9bd6492.tar.bz2 llvm-edd08f74289c6ba3b3f8e730e4ab825ef9bd6492.tar.xz |
SelectionDAG: Remove unnecessary uses of TargetLowering::getPointerTy()
If we have a binary operation like ISD:ADD, we can set the result type
equal to the result type of one of its operands rather than using
TargetLowering::getPointerTy().
Also, any use of DAG.getIntPtrConstant(C) as an operand for a binary
operation can be replaced with:
DAG.getConstant(C, OtherOperand.getValueType());
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189227 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp b/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp index 07ee03e95e..6e5fdca361 100644 --- a/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp +++ b/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp @@ -434,7 +434,7 @@ SDValue VectorLegalizer::ExpandLoad(SDValue Op) { RemainingBytes -= LoadBytes; Offset += LoadBytes; BasePTR = DAG.getNode(ISD::ADD, dl, BasePTR.getValueType(), BasePTR, - DAG.getIntPtrConstant(LoadBytes)); + DAG.getConstant(LoadBytes, BasePTR.getValueType())); LoadVals.push_back(ScalarLoad.getValue(0)); LoadChains.push_back(ScalarLoad.getValue(1)); @@ -502,7 +502,7 @@ SDValue VectorLegalizer::ExpandLoad(SDValue Op) { LD->getAlignment()); BasePTR = DAG.getNode(ISD::ADD, dl, BasePTR.getValueType(), BasePTR, - DAG.getIntPtrConstant(Stride)); + DAG.getConstant(Stride, BasePTR.getValueType())); Vals.push_back(ScalarLoad.getValue(0)); LoadChains.push_back(ScalarLoad.getValue(1)); @@ -561,7 +561,7 @@ SDValue VectorLegalizer::ExpandStore(SDValue Op) { isVolatile, isNonTemporal, Alignment); BasePTR = DAG.getNode(ISD::ADD, dl, BasePTR.getValueType(), BasePTR, - DAG.getIntPtrConstant(Stride)); + DAG.getConstant(Stride, BasePTR.getValueType())); Stores.push_back(Store); } |