diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-06 05:28:41 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-06 05:28:41 +0000 |
commit | aa5f524095772f54ff83e34634a966ebd74b4f13 (patch) | |
tree | ca09adff3d9f3fa1c0ef2579b146bdd80c6febc2 /llvm/lib/Analysis | |
parent | 5dc5a8e5be002ed478cbdf457ead9ae7ff84152f (diff) | |
download | bcm5719-llvm-aa5f524095772f54ff83e34634a966ebd74b4f13.tar.gz bcm5719-llvm-aa5f524095772f54ff83e34634a966ebd74b4f13.zip |
[InstSimplify] Teach SimplifyAddInst and SimplifySubInst that vectors of i1 can be treated as Xor too.
llvm-svn: 299626
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r-- | llvm/lib/Analysis/InstructionSimplify.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/InstructionSimplify.cpp b/llvm/lib/Analysis/InstructionSimplify.cpp index 5cb93df7395..85fcbcccb2c 100644 --- a/llvm/lib/Analysis/InstructionSimplify.cpp +++ b/llvm/lib/Analysis/InstructionSimplify.cpp @@ -579,7 +579,7 @@ static Value *SimplifyAddInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, return Y; /// i1 add -> xor. - if (MaxRecurse && Op0->getType()->isIntegerTy(1)) + if (MaxRecurse && Op0->getType()->getScalarType()->isIntegerTy(1)) if (Value *V = SimplifyXorInst(Op0, Op1, Q, MaxRecurse-1)) return V; @@ -796,7 +796,7 @@ static Value *SimplifySubInst(Value *Op0, Value *Op1, bool isNSW, bool isNUW, return ConstantExpr::getIntegerCast(Result, Op0->getType(), true); // i1 sub -> xor. - if (MaxRecurse && Op0->getType()->isIntegerTy(1)) + if (MaxRecurse && Op0->getType()->getScalarType()->isIntegerTy(1)) if (Value *V = SimplifyXorInst(Op0, Op1, Q, MaxRecurse-1)) return V; |