[llvm-commits] [llvm] r157592 - /llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Benjamin Kramer
benny.kra at googlemail.com
Mon May 28 13:52:48 PDT 2012
Author: d0k
Date: Mon May 28 15:52:48 2012
New Revision: 157592
URL: http://llvm.org/viewvc/llvm-project?rev=157592&view=rev
Log:
Fix suspicous hasOneUse() check, found by PVS Studio (PR12357).
Modified:
llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
Modified: llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp?rev=157592&r1=157591&r2=157592&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp (original)
+++ llvm/trunk/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp Mon May 28 15:52:48 2012
@@ -2217,7 +2217,7 @@
if (Op0I && Op1I && Op0I->isShift() &&
Op0I->getOpcode() == Op1I->getOpcode() &&
Op0I->getOperand(1) == Op1I->getOperand(1) &&
- (Op1I->hasOneUse() || Op1I->hasOneUse())) {
+ (Op0I->hasOneUse() || Op1I->hasOneUse())) {
Value *NewOp =
Builder->CreateXor(Op0I->getOperand(0), Op1I->getOperand(0),
Op0I->getName());
More information about the llvm-commits
mailing list