X86: optimized i64 vector multiply with constant
authorElena Demikhovsky <elena.demikhovsky@intel.com>
Tue, 16 Jun 2015 06:07:24 +0000 (06:07 +0000)
committerElena Demikhovsky <elena.demikhovsky@intel.com>
Tue, 16 Jun 2015 06:07:24 +0000 (06:07 +0000)
commit05e61f71137f101e831877ee123fd4c74cfccb3c
treeb602684433bc82783fbad5fb8642ba39fdf4efc9
parentf428f1732a14694005aca8079786201e046533cb
X86: optimized i64 vector multiply with constant

When we multiply two 64-bit vectors, we extract lower and upper part and use the PMULUDQ instruction.
When one of the operands is a constant, the upper part may be zero, we know this at compile time.
Example: %a = mul <4 x i64> %b, <4 x i64> < i64 5, i64 5, i64 5, i64 5>.
I'm checking the value of the upper part and prevent redundant "multiply", "shift" and "add" operations.

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