[llvm-commits] CVS: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
Chris Lattner
lattner at cs.uiuc.edu
Sat Apr 15 16:48:17 PDT 2006
Changes in directory llvm/lib/Target/PowerPC:
PPCISelLowering.cpp updated: 1.151 -> 1.152
---
Log message:
Fix a crash when faced with a shuffle vector that has an undef in its mask.
---
Diffs of the changes: (+5 -1)
PPCISelLowering.cpp | 6 +++++-
1 files changed, 5 insertions(+), 1 deletion(-)
Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff -u llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.151 llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.152
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp:1.151 Fri Apr 14 18:19:08 2006
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp Sat Apr 15 18:48:05 2006
@@ -1116,7 +1116,11 @@
std::vector<SDOperand> ResultMask;
for (unsigned i = 0, e = PermMask.getNumOperands(); i != e; ++i) {
- unsigned SrcElt =cast<ConstantSDNode>(PermMask.getOperand(i))->getValue();
+ unsigned SrcElt;
+ if (PermMask.getOperand(i).getOpcode() == ISD::UNDEF)
+ SrcElt = 0;
+ else
+ SrcElt = cast<ConstantSDNode>(PermMask.getOperand(i))->getValue();
for (unsigned j = 0; j != BytesPerElement; ++j)
ResultMask.push_back(DAG.getConstant(SrcElt*BytesPerElement+j,
More information about the llvm-commits
mailing list