[CodeGen] Fix invalid shift in mul expansion
authorPawel Bylica <chfast@gmail.com>
Tue, 13 Sep 2016 21:55:41 +0000 (21:55 +0000)
committerPawel Bylica <chfast@gmail.com>
Tue, 13 Sep 2016 21:55:41 +0000 (21:55 +0000)
commitc397f0b2724643adbd945acf6f7197b61e74fdc4
tree9edadf18f089417932a50bcb9e7489625db1a291
parent59f830530557f25ab6bda5cc5c1401ea127b6f4d
[CodeGen] Fix invalid shift in mul expansion

Summary: When expanding mul in type legalization make sure the type for shift amount can actually fit the value. This fixes PR30354 https://llvm.org/bugs/show_bug.cgi?id=30354.

Reviewers: hfinkel, majnemer, RKSimon

Subscribers: RKSimon, llvm-commits

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

llvm-svn: 281403
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
llvm/test/CodeGen/X86/mul-i1024.ll [new file with mode: 0644]
llvm/test/CodeGen/X86/mul-i512.ll [new file with mode: 0644]