diff options
author | James Molloy <james.molloy@arm.com> | 2016-08-19 08:38:50 +0000 |
---|---|---|
committer | James Molloy <james.molloy@arm.com> | 2016-08-19 08:38:50 +0000 |
commit | 7ee640f9b67e3269f19bbe166bbba6a93c0ee148 (patch) | |
tree | 2c685d2803a7a7030ac3be420c5e3d06488a7530 /llvm/lib | |
parent | b81960a6c858b4d40d64798cac3e56ca8e6383fa (diff) | |
download | bcm5719-llvm-7ee640f9b67e3269f19bbe166bbba6a93c0ee148.tar.gz bcm5719-llvm-7ee640f9b67e3269f19bbe166bbba6a93c0ee148.zip |
[CodeGen] Fix a trivial type conversion bug dating back to pre-2008
The heuristic above this code is incredibly suspect, but disregarding that it mutates the cast opcode so we need to check the *mutated* opcode later to see if we need to emit an AssertSext or AssertZext node.
Fixes PR29041.
llvm-svn: 279223
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp index 4d776f522af..a4ab37e7f8e 100644 --- a/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -427,7 +427,7 @@ SDValue DAGTypeLegalizer::PromoteIntRes_FP_TO_XINT(SDNode *N) { // Assert that the converted value fits in the original type. If it doesn't // (eg: because the value being converted is too big), then the result of the // original operation was undefined anyway, so the assert is still correct. - return DAG.getNode(N->getOpcode() == ISD::FP_TO_UINT ? + return DAG.getNode(NewOpc == ISD::FP_TO_UINT ? ISD::AssertZext : ISD::AssertSext, dl, NVT, Res, DAG.getValueType(N->getValueType(0).getScalarType())); } |