[PATCH] D86050: [SCEV] Refactor isHighCostExpansionHelper

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 23 23:15:32 PDT 2020


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp:2056-2064
     if (OrigPhiRef->getType()->isPointerTy() != Phi->getType()->isPointerTy())
       continue;
 
     if (BasicBlock *LatchBlock = L->getLoopLatch()) {
       Instruction *OrigInc = dyn_cast<Instruction>(
           OrigPhiRef->getIncomingValueForBlock(LatchBlock));
       Instruction *IsomorphicInc =
----------------
I guess i'm starting getting confused again and thus stalling, but.

>>! In D86050#2232843, @samparker wrote:
>> Please can you explain why the calculated costs changed for those X86 tests?
> These were introduced once the Add and Mul expressions were costed in the same manner as when we're calculating for an AddRec.

Right. But why was that done in the first place? Was that intentional?
That doesn't look correct to me.

Plain `Add` and `Mul` are *not* identical to `AddRec`.

> I'll remove the change for this patch and add it back in a follow-up.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D86050/new/

https://reviews.llvm.org/D86050



More information about the llvm-commits mailing list