summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorSanjay Patel <spatel@rotateright.com>2019-04-03 22:40:35 +0000
committerSanjay Patel <spatel@rotateright.com>2019-04-03 22:40:35 +0000
commitc9a012e4eab7f2e9aa8701451b0bf7c6b80222ac (patch)
tree27b0d0adb5db432c6fd53f3fb3e8aa57d71e4d2f /llvm/lib
parent144a43a2fdb863020ffbd06601619fead9a3a3fc (diff)
downloadbcm5719-llvm-c9a012e4eab7f2e9aa8701451b0bf7c6b80222ac.tar.gz
bcm5719-llvm-c9a012e4eab7f2e9aa8701451b0bf7c6b80222ac.zip
[x86] fold shuffles of h-ops that have an undef operand
If an operand is undef, we can assume it's the same as the other operand. llvm-svn: 357644
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 84009979ea1..a05fd557ca2 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -32880,8 +32880,8 @@ static SDValue foldShuffleOfHorizOp(SDNode *N) {
// lanes of each operand as:
// v4X32: A[0] + A[1] , A[2] + A[3] , B[0] + B[1] , B[2] + B[3]
// ...similarly for v2f64 and v8i16.
- // TODO: Handle UNDEF operands.
- if (HOp.getOperand(0) != HOp.getOperand(1))
+ if (!HOp.getOperand(0).isUndef() && !HOp.getOperand(1).isUndef() &&
+ HOp.getOperand(0) != HOp.getOperand(1))
return SDValue();
// When the operands of a horizontal math op are identical, the low half of
OpenPOWER on IntegriCloud