Dependency analysis vs memory SSA

I’m trying to familiarize myself with LLVM’s dependency analysis infrastructure to write a new pass. I see that opt has a --da flag for seemingly generic dependency analysis of memory operations, but there’s also the memory SSA pass which, according to the documentation page, seems to aim to be the go to for memory reference dependency analysis. The two passes give different outputs with opt as well, and I’m curious what each of their roles are meant to be and what one does that the other doesn’t.

Also, which pass does the auto-vectoriser use to determine if vectorisation is valid? Or is it a combination?

Thanks.

–da does a subscript based dependency analysis and is meant for finer grained analysis on multi-dimensional accesses, producing direction vectors and dependence distances. MemorySSA represents memory dependences as def-use edges and is much more widely used in LLVM. I believe loop vectorizer uses LoopAccessInfo.

1 Like