diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2009-06-06 20:08:03 +0000 | 
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2009-06-06 20:08:03 +0000 | 
| commit | 73a83066d546336ca0c058ad50321983b3c27f9a (patch) | |
| tree | cb0c6e83e146799359c1f26cef959e74dba4d7eb /llvm/lib/Transforms | |
| parent | 07bbeca4062451701482e6dceb141790bc2f42a9 (diff) | |
| download | bcm5719-llvm-73a83066d546336ca0c058ad50321983b3c27f9a.tar.gz bcm5719-llvm-73a83066d546336ca0c058ad50321983b3c27f9a.zip | |
PR4340: Run SimplifyDemandedVectorElts on insertelement instructions; 
sometimes it can find simplifications that won't be found otherwise.
llvm-svn: 73006
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 97bd34c771c..6d2ff0e3e53 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -12579,6 +12579,12 @@ Instruction *InstCombiner::visitInsertElementInst(InsertElementInst &IE) {      }    } +  unsigned VWidth = cast<VectorType>(VecOp->getType())->getNumElements(); +  APInt UndefElts(VWidth, 0); +  APInt AllOnesEltMask(APInt::getAllOnesValue(VWidth)); +  if (SimplifyDemandedVectorElts(&IE, AllOnesEltMask, UndefElts)) +    return &IE; +    return 0;  } | 

