diff options
author | Dan Gohman <gohman@apple.com> | 2009-01-28 02:58:31 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-01-28 02:58:31 +0000 |
commit | 172ad92b290e492bb8d66ee39c6a8ea4299568b0 (patch) | |
tree | 04ff33f7666a115c21d9a345738b731f5dcb8e8b /llvm/lib/CodeGen/SelectionDAG | |
parent | 5d1ebe90b377419fc37ae6853651c0b5881d43b0 (diff) | |
download | bcm5719-llvm-172ad92b290e492bb8d66ee39c6a8ea4299568b0.tar.gz bcm5719-llvm-172ad92b290e492bb8d66ee39c6a8ea4299568b0.zip |
Use ZERO_EXTEND instead of ANY_EXTEND when promoting
shift amounts, to avoid implicitly assuming that
target architectures will ignore the high bits.
llvm-svn: 63169
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp | 2 | ||||
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp index 58ac8c285c9..4ee17bf807c 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp @@ -974,7 +974,7 @@ SDValue SelectionDAGLegalize::LegalizeShiftAmount(SDValue ShiftAmt) { return DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), ShiftAmt); if (TLI.getShiftAmountTy().bitsGT(ShiftAmt.getValueType())) - return DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), ShiftAmt); + return DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), ShiftAmt); return ShiftAmt; } diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp index 3823f65263a..420a8d374c6 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp @@ -114,7 +114,7 @@ SDValue DAGTypeLegalizer::ScalarizeVecRes_ShiftOp(SDNode *N) { if (TLI.getShiftAmountTy().bitsLT(ShiftAmt.getValueType())) ShiftAmt = DAG.getNode(ISD::TRUNCATE, TLI.getShiftAmountTy(), ShiftAmt); else if (TLI.getShiftAmountTy().bitsGT(ShiftAmt.getValueType())) - ShiftAmt = DAG.getNode(ISD::ANY_EXTEND, TLI.getShiftAmountTy(), ShiftAmt); + ShiftAmt = DAG.getNode(ISD::ZERO_EXTEND, TLI.getShiftAmountTy(), ShiftAmt); return DAG.getNode(N->getOpcode(), LHS.getValueType(), LHS, ShiftAmt); } |