]> granicus.if.org Git - llvm/commitdiff
[Transforms] Redundant getValueOperand (NFC)
authorBrian Gesiak <modocache@gmail.com>
Tue, 2 Apr 2019 14:57:56 +0000 (14:57 +0000)
committerBrian Gesiak <modocache@gmail.com>
Tue, 2 Apr 2019 14:57:56 +0000 (14:57 +0000)
`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

lib/Transforms/Utils/Local.cpp

index 9271e1dda5a5356c7c3e42d3f1ea3c5b63135870..429ae85596f74e314274f6cd2019e95fa5c8bffc 100644 (file)
@@ -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: "