Reverting [SCEV][IndVarSimplify] insert point should not be block front

Serge Guelton via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 14 06:03:00 PDT 2020


Hi Chen Zheng,

I've reverted commit f1efb8bb4ba0584a9b994f3404a2c62920ce6652

    [SCEV][IndVarSimplify] insert point should not be block front.

because it breaks validation (a recent expensive check that tests return status
of LLVM passes).

The check fails because of these lines:

    WidePhi = dyn_cast<PHINode>(Rewriter.expandCodeFor(AddRec, WideType, InsertPt));
    if (!WidePhi)
      return nullptr;

Basically `Rewriter.expandCodeFor` generates new instructions but if the `return
nullptr` path is taken, the caller considers nothing happens, and this may end
up with the pass claiming no change while something actually happening.

I could have patched the caller to take the change into account, but it seems it
hides a deeper issue: in the case of that early exit, no code should be added,
or we should remove it.

Can you please update the patch to take that into account?

Thanks, and again sorry for reverting the patch. It seems to me it's better to revert
this patch than reverting the check. 

Best,

Serge



More information about the llvm-commits mailing list