X86: When lowering shl_parts, don't emit shift amounts larger than the bit width.
authorBenjamin Kramer <benny.kra@googlemail.com>
Fri, 13 Dec 2013 13:40:24 +0000 (13:40 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Fri, 13 Dec 2013 13:40:24 +0000 (13:40 +0000)
commitfd2b2bd6b39dadf9051c0ca4c6cec8f562f8e0e4
treeec454b138c9bb5cf2f8117e54135b66b70b95032
parentaca2998f143ae021e4c3999e32a68cfc084a3ba0
X86: When lowering shl_parts, don't emit shift amounts larger than the bit width.

While it's safe for the X86-specific shift nodes, dag combining will
kill generic nodes. Insert an AND to make it safe, isel will nuke it
as x86's shift instructions have an implicit AND.

Fixes PR16108, which contains a contraption to hit this case in between
constant folders.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@197228 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/X86ISelLowering.cpp
test/CodeGen/X86/legalize-shift-64.ll