[llvm-dev] Request suggestions about how to remove redundencies caused by SCEV expansion fundementally

Sanjoy Das via llvm-dev llvm-dev at lists.llvm.org
Mon Aug 29 13:51:17 PDT 2016

Hi Wei,

Wei Mi wrote:
 > To rephrase it and see if I understand it correctly:
 > Existing Value A;
 > Expanded Value B (B is identical with A, but in a different form);
 > So we can convert both A and B to SCEV again and compare their
 > equivalence and use the result to guide strength reduction. It is like
 > to enhance existing cleanup pass using the SCEV CSE rules.

Yes.  And we don't necessarily have to worry about exact matches
either, we can (for instance) check if getMinusSCEV(getSCEV(A),
getSCEV(B)) is a constant, and use that to cheaply expand B.

 > Or the idea of simplify is to transform B back to the form close to A
 > with SCEV knowledge?

No, that's not what I had in mind.

-- Sanjoy

More information about the llvm-dev mailing list