summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-14 22:53:18 +0000
committerDan Gohman <gohman@apple.com>2008-08-14 22:53:18 +0000
commit7c2bf62b1403f55a894a6d776f5236c11311673d (patch)
tree5d6b9ece6294c7739aa4816d857f0953345c6857
parent4f6bf04616b01fef8740ff68427a8ae0c570b923 (diff)
downloadbcm5719-llvm-7c2bf62b1403f55a894a6d776f5236c11311673d.tar.gz
bcm5719-llvm-7c2bf62b1403f55a894a6d776f5236c11311673d.zip
Also avoid pinsrw and pinsrb with a variable insertelement index.
llvm-svn: 54803
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 6b95034c02b..6488a1a8327 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -4143,7 +4143,8 @@ X86TargetLowering::LowerINSERT_VECTOR_ELT_SSE4(SDValue Op, SelectionDAG &DAG){
SDValue N1 = Op.getOperand(1);
SDValue N2 = Op.getOperand(2);
- if ((EVT.getSizeInBits() == 8) || (EVT.getSizeInBits() == 16)) {
+ if ((EVT.getSizeInBits() == 8 || EVT.getSizeInBits() == 16) &&
+ isa<ConstantSDNode>(N2)) {
unsigned Opc = (EVT.getSizeInBits() == 8) ? X86ISD::PINSRB
: X86ISD::PINSRW;
// Transform it so it match pinsr{b,w} which expects a GR32 as its second
OpenPOWER on IntegriCloud