Fix *_EXTEND_VECTOR_INREG legalization
authorPirama Arumuga Nainar <pirama@google.com>
Thu, 20 Oct 2016 17:56:36 +0000 (17:56 +0000)
committerPirama Arumuga Nainar <pirama@google.com>
Thu, 20 Oct 2016 17:56:36 +0000 (17:56 +0000)
commit05b0f93ad33dd5df9f69ae5eb0b48d9f76304eb2
tree8d4875053a1fa5aa9359e7738d541a6bd6388f46
parentbadd5b31b733febc58644d3fdbb23d1b448aeadb
Fix *_EXTEND_VECTOR_INREG legalization

Summary:
While promoting *_EXTEND_VECTOR_INREG nodes whose inputs are already
promoted, perform the appropriate sign extension for the promoted node
before doing the *_EXTEND_VECTOR_INREG operation.  If not, the undefined
high-order bits of the promoted operand may (a) be garbage inc ase of
zext) or (b) contribute the wrong sign-bit (in case of sext)

Updated the promote-vec3.ll test after this change.  The diff shows
explicit zeroing in case of zext and intermediate sign extension in case
of sext.

Reviewers: RKSimon

Subscribers: llvm-commits, srhines

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

llvm-svn: 284752
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/test/CodeGen/X86/promote-vec3.ll