diff options
| author | Sanjay Patel <spatel@rotateright.com> | 2017-03-09 21:56:03 +0000 |
|---|---|---|
| committer | Sanjay Patel <spatel@rotateright.com> | 2017-03-09 21:56:03 +0000 |
| commit | 962a8431ea58f930a4598e9589d3c09161430046 (patch) | |
| tree | be13f4b1ee1d9586096dc2a570cdad98cbe9834c /llvm/lib | |
| parent | 7a9ea8f628f863c2cde41e63be45a2e47fbd95ef (diff) | |
| download | bcm5719-llvm-962a8431ea58f930a4598e9589d3c09161430046.tar.gz bcm5719-llvm-962a8431ea58f930a4598e9589d3c09161430046.zip | |
[InstSimplify] allow folds for bool vector div/rem
llvm-svn: 297411
Diffstat (limited to 'llvm/lib')
| -rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index f63b1aea795..08afafa7457 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -1052,9 +1052,9 @@ static Value *simplifyDivRem(Value *Op0, Value *Op1, bool IsDiv) { // X / 1 -> X // X % 1 -> 0 - // If this is a boolean op (single-bit type), we can't have division-by-zero - // or remainder-by-zero, so assume the divisor is 1. - if (match(Op1, m_One()) || Ty->isIntegerTy(1)) + // If this is a boolean op (single-bit element type), we can't have + // division-by-zero or remainder-by-zero, so assume the divisor is 1. + if (match(Op1, m_One()) || Ty->getScalarType()->isIntegerTy(1)) return IsDiv ? Op0 : Constant::getNullValue(Ty); return nullptr; |

