diff options
| author | Craig Topper <craig.topper@gmail.com> | 2017-04-11 05:42:47 +0000 |
|---|---|---|
| committer | Craig Topper <craig.topper@gmail.com> | 2017-04-11 05:42:47 +0000 |
| commit | 18f9e424e7a8ad4688b114225f0e7a51f0fdb35b (patch) | |
| tree | 4d3129d9e5f98b7e9d9b95bf6f6ed77467eb4a19 /llvm/lib/Transforms/InstCombine | |
| parent | 7b5a4dfd46a28d4af766422da345c1a4ec71115c (diff) | |
| download | bcm5719-llvm-18f9e424e7a8ad4688b114225f0e7a51f0fdb35b.tar.gz bcm5719-llvm-18f9e424e7a8ad4688b114225f0e7a51f0fdb35b.zip | |
[InstCombine] Support weird size element types in dyn_castNegVal.
llvm-svn: 299915
Diffstat (limited to 'llvm/lib/Transforms/InstCombine')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstructionCombining.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp index 398b49748ec..3c6f07e7fdd 100644 --- a/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -726,6 +726,10 @@ Value *InstCombiner::dyn_castNegVal(Value *V) const { if (C->getType()->getElementType()->isIntegerTy()) return ConstantExpr::getNeg(C); + if (ConstantVector *C = dyn_cast<ConstantVector>(V)) + if (C->getType()->getElementType()->isIntegerTy()) + return ConstantExpr::getNeg(C); + return nullptr; } |

