OSDN Git Service

[CodeGen] Fix result type for SMULO/UMULO legalization
authorEli Friedman <efriedma@codeaurora.org>
Tue, 6 Dec 2016 22:49:36 +0000 (22:49 +0000)
committerEli Friedman <efriedma@codeaurora.org>
Tue, 6 Dec 2016 22:49:36 +0000 (22:49 +0000)
commit0e51e5e82d0c128b7779df25fac11b4c67d50425
treee48fc8a7fee618afab0f8a550eb4fef8f027d230
parent6b92e1ac7057e290f8e141c919d1e711bcb40fdf
[CodeGen] Fix result type for SMULO/UMULO legalization

On some platforms (like MSP430) the second element of the result
structure for SMULO/UMULO may have a shorter type than the one
returned by SetCC. We need to truncate it to the right type, or
else some incorrect code may be generated later on.

This fixes issue https://github.com/rust-lang/rust/issues/37829

Patch by Vadzim Dambrouski!

Differential Revision: https://reviews.llvm.org/D27154

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288857 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
test/CodeGen/MSP430/umulo-16.ll [new file with mode: 0644]