From: Brian Gesiak Date: Tue, 2 Apr 2019 14:57:56 +0000 (+0000) Subject: [Transforms] Redundant getValueOperand (NFC) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0d0b07731ebafba9220824f6a7b638af9a51891;p=llvm [Transforms] Redundant getValueOperand (NFC) `StoreInst::getValueOperand` is identical to `getOperand(0)`, so the call to `getOperand(0)` can be replaced. Further, `SI->getValueOperand` is redundantly called just a few lines down, despite its return value being stored in variable `DV`. No functional change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@357479 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Utils/Local.cpp b/lib/Transforms/Utils/Local.cpp index 9271e1dda5a..429ae85596f 100644 --- a/lib/Transforms/Utils/Local.cpp +++ b/lib/Transforms/Utils/Local.cpp @@ -1292,9 +1292,9 @@ void llvm::ConvertDebugDeclareToDebugValue(DbgVariableIntrinsic *DII, auto *DIVar = DII->getVariable(); assert(DIVar && "Missing variable"); auto *DIExpr = DII->getExpression(); - Value *DV = SI->getOperand(0); + Value *DV = SI->getValueOperand(); - if (!valueCoversEntireFragment(SI->getValueOperand()->getType(), DII)) { + if (!valueCoversEntireFragment(DV->getType(), DII)) { // FIXME: If storing to a part of the variable described by the dbg.declare, // then we want to insert a dbg.value for the corresponding fragment. LLVM_DEBUG(dbgs() << "Failed to convert dbg.declare to dbg.value: "