[InstCombine] visitFCmpInst - appease copy+paste pattern warning. NFCI.
authorSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 29 Apr 2019 18:52:19 +0000 (18:52 +0000)
committerSimon Pilgrim <llvm-dev@redking.me.uk>
Mon, 29 Apr 2019 18:52:19 +0000 (18:52 +0000)
PVS Studio's copy+paste recognizer was seeing this as a typo, technically Op0/Op1 in a fcmp should always be the same type, but we might as well avoid the issue.

Reported in https://www.viva64.com/en/b/0629/

llvm-svn: 359482

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

index c73a095..b27ddb7 100644 (file)
@@ -5512,7 +5512,7 @@ Instruction *InstCombiner::visitFCmpInst(FCmpInst &I) {
       return &I;
     }
     if (!match(Op1, m_PosZeroFP()) && isKnownNeverNaN(Op1, &TLI)) {
-      I.setOperand(1, ConstantFP::getNullValue(Op0->getType()));
+      I.setOperand(1, ConstantFP::getNullValue(Op1->getType()));
       return &I;
     }
   }