[PATCH] D26088: Don't leave unused divs/rems sitting around in BypassSlowDivision.
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 28 11:13:50 PDT 2016
tra added inline comments.
================
Comment at: llvm/lib/Transforms/Utils/BypassSlowDivision.cpp:251
+ // Above we eagerly create divs and rems, as pairs, so that we can efficiently
+ // create divrem machine instructions. Now erase unused any divs / rems so we
+ // don't leave extra instructions sitting around.
----------------
Should it be "erase any unused divs/rems..."?
================
Comment at: llvm/lib/Transforms/Utils/BypassSlowDivision.cpp:260
+ for (Value *Operand : Phi->operand_values())
+ if (Instruction *I = dyn_cast<Instruction>(Operand))
+ ToErase.push_back(I);
----------------
What's supposed to happen with operands that are not instructions?
Destruction of unused subgraph sounds like a common operation, perhaps we already have a function to do it?
https://reviews.llvm.org/D26088
More information about the llvm-commits
mailing list