summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
diff options
context:
space:
mode:
authorPete Cooper <peter_cooper@apple.com>2015-07-15 00:43:54 +0000
committerPete Cooper <peter_cooper@apple.com>2015-07-15 00:43:54 +0000
commit8acd3869694883cffc08e3a21929208055e7a845 (patch)
treee2f8bc50a5aa7f60c343317c6ac44821bf62f203 /llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
parent33fb2cb11b7d2454bd2d97fe95c11ed38679327b (diff)
downloadbcm5719-llvm-8acd3869694883cffc08e3a21929208055e7a845.tar.gz
bcm5719-llvm-8acd3869694883cffc08e3a21929208055e7a845.zip
Use getZExtOrTrunc helper instead of manually doing zext/trunc check. NFC.
The code here was doing exactly what is already in getZExtOrTrunc(). Just use that method instead. llvm-svn: 242260
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
index 21ab07234c8..51057a0fecb 100644
--- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
@@ -599,8 +599,7 @@ PerformInsertVectorEltInMemory(SDValue Vec, SDValue Val, SDValue Idx,
false, false, 0);
// Truncate or zero extend offset to target pointer type.
- unsigned CastOpc = IdxVT.bitsGT(PtrVT) ? ISD::TRUNCATE : ISD::ZERO_EXTEND;
- Tmp3 = DAG.getNode(CastOpc, dl, PtrVT, Tmp3);
+ Tmp3 = DAG.getZExtOrTrunc(Tmp3, dl, PtrVT);
// Add the offset to the index.
unsigned EltSize = EltVT.getSizeInBits()/8;
Tmp3 = DAG.getNode(ISD::MUL, dl, IdxVT, Tmp3,
OpenPOWER on IntegriCloud