[PATCH] D28743: [PM] Teach the LoopPassManager to automatically canonicalize loops by runnig LCSSA over them prior to running the loop pipeline.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 16 18:02:22 PST 2017

davide added a comment.

Some minor comments , but I think this is good to go. I'll review the other related patch soon'ish.

Comment at: include/llvm/Transforms/Scalar/LoopPassManager.h:52-54
+#include "llvm/Transforms/Utils/LCSSA.h"
 #include "llvm/IR/Dominators.h"
 #include "llvm/IR/PassManager.h"
Nit: unsorted (IR < Transforms)

Comment at: test/Analysis/IVUsers/quadradic-exit-value.ll:8
-; RUN: opt < %s -analyze -iv-users | FileCheck %s
+; RUN: opt < %s -analyze -iv-users | FileCheck %s --check-prefixes=CHECK,CHECK-NO-LCSSA
 ; RUN: opt < %s -disable-output -passes='print<ivusers>' 2>&1 | FileCheck %s
chandlerc wrote:
> davide wrote:
> > Why two prefixes here?
> Below, we only use the one prefix.
> Without LCSSA, we get substantially more precise results here, whereas with it we get substantially more poor results. This is because of a combined weakness of SCEV and IVUsers which stems from SCEVExpander's inability to expand correctly in LCSSA form. =[ It's a mess.
> I've talked to Michael (K) and Sanjoy about this and we have some ideas to fix this eventually, but not right away. (Fortunately, the only thing that cares today is LSR which is in the codegen phase and so not blocking anything.)
> I wrote the FIXME above this to document what is going on here.
Oh, sorry, I missed the fixme. Ignore my comment.


More information about the llvm-commits mailing list