diff options
| author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-12-31 17:07:47 +0000 |
|---|---|---|
| committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2017-12-31 17:07:47 +0000 |
| commit | f205ec716b2ba439d6ccbfd5f564c5cb5666a376 (patch) | |
| tree | 25397d7bc5b8dffe6123008f8adc28efa3694941 /llvm/lib | |
| parent | 86b7949f62168e7aab6372790e16ae0038b63d84 (diff) | |
| download | bcm5719-llvm-f205ec716b2ba439d6ccbfd5f564c5cb5666a376.tar.gz bcm5719-llvm-f205ec716b2ba439d6ccbfd5f564c5cb5666a376.zip | |
[X86][SSE] Don't vectorize splat buildvector of binops (PR30780)
Don't combine buildvector(binop(),binop(),binop(),binop()) -> binop(buildvector(), buildvector()) if its a splat - keep the binop scalar and just splat the result to avoid large vector constants.
llvm-svn: 321607
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Target/X86/X86ISelLowering.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp index 33327ca6b79..19bff03f26a 100644 --- a/llvm/lib/Target/X86/X86ISelLowering.cpp +++ b/llvm/lib/Target/X86/X86ISelLowering.cpp @@ -7723,6 +7723,10 @@ static SDValue lowerBuildVectorToBitOp(BuildVectorSDNode *Op, case ISD::AND: case ISD::XOR: case ISD::OR: + // Don't do this if the buildvector is a splat - we'd replace one + // constant with an entire vector. + if (Op->getSplatValue()) + return SDValue(); if (!TLI.isOperationLegalOrPromote(Opcode, VT)) return SDValue(); break; |

