[llvm] r265833 - ValueMapper: Always use Mapper::mapValue from remapInstruction, NFCI

Duncan P. N. Exon Smith via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 8 12:17:13 PDT 2016


Author: dexonsmith
Date: Fri Apr  8 14:17:13 2016
New Revision: 265833

URL: http://llvm.org/viewvc/llvm-project?rev=265833&view=rev
Log:
ValueMapper: Always use Mapper::mapValue from remapInstruction, NFCI

Use Mapper::mapValue instead of llvm::MapValue from
Mapper::remapInstruction when mapping an incoming block for a PHINode
(follow-up to r265832).  This will implicitly pass along the
Materializer argument, but when this code was added in r133513 there was
no Materializer argument.  I suspect this call to MapValue was just
missed in r182776 since it's not observable (basic blocks can't be
materialized, and they don't reference other values).

Modified:
    llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp

Modified: llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp?rev=265833&r1=265832&r2=265833&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/ValueMapper.cpp Fri Apr  8 14:17:13 2016
@@ -757,8 +757,7 @@ void Mapper::remapInstruction(Instructio
   // Remap phi nodes' incoming blocks.
   if (PHINode *PN = dyn_cast<PHINode>(I)) {
     for (unsigned i = 0, e = PN->getNumIncomingValues(); i != e; ++i) {
-      // FIXME: Use Mapper::mapValue (but note the missing Materializer flag).
-      Value *V = MapValue(PN->getIncomingBlock(i), VM, Flags);
+      Value *V = mapValue(PN->getIncomingBlock(i));
       // If we aren't ignoring missing entries, assert that something happened.
       if (V)
         PN->setIncomingBlock(i, cast<BasicBlock>(V));




More information about the llvm-commits mailing list