summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2016-03-11 22:18:05 +0000
committerSimon Pilgrim <llvm-dev@redking.me.uk>2016-03-11 22:18:05 +0000
commit33d57c754741a1f90e648c7323d72e83dd575925 (patch)
tree9cefc4a424666284cedff600d384219e4e2f804a /llvm/lib/Target/X86
parentbe50836514aba9ccc99901e49d5ed0c52dbbbff6 (diff)
downloadbcm5719-llvm-33d57c754741a1f90e648c7323d72e83dd575925.tar.gz
bcm5719-llvm-33d57c754741a1f90e648c7323d72e83dd575925.zip
[X86][SSE] Simplify vector LOAD + EXTEND on pre-SSE41 hardware
Improve vector extension of vectors on hardware without dedicated VSEXT/VZEXT instructions. We already convert these to SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG but can further improve this by using the legalizer instead of prematurely splitting into legal vectors in the combine as this only properly helps for lowering to VSEXT/VZEXT. Removes a lot of unnecessary any_extend + mask pattern - (Fix for PR25718). Differential Revision: http://reviews.llvm.org/D17932 llvm-svn: 263303
Diffstat (limited to 'llvm/lib/Target/X86')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 4f00eb32f94..eac67d1e67d 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -28534,7 +28534,9 @@ static SDValue combineToExtendVectorInReg(SDNode *N, SelectionDAG &DAG,
// If target-size is 128-bits (or 256-bits on AVX2 target), then convert to
// ISD::*_EXTEND_VECTOR_INREG which ensures lowering to X86ISD::V*EXT.
- if (VT.is128BitVector() || (VT.is256BitVector() && Subtarget.hasInt256())) {
+ // Also use this if we don't have SSE41 to allow the legalizer do its job.
+ if (!Subtarget.hasSSE41() || VT.is128BitVector() ||
+ (VT.is256BitVector() && Subtarget.hasInt256())) {
SDValue ExOp = ExtendVecSize(DL, N0, VT.getSizeInBits());
return Opcode == ISD::SIGN_EXTEND
? DAG.getSignExtendVectorInReg(ExOp, DL, VT)
OpenPOWER on IntegriCloud