Enabling loop-interchange

The problem is not that delinearization is using getSourceElementType(), it’s what it does with it. You are not allowed to drive optimization heuristics based on the structural type information in a GEP. You can only make use of the offset calculation that type implies. The type information will go away entirely in the future, once the ongoing migration to ptradd representation completes.

A typical way to replace the type access is to use collectOffset(), which converts it into an explicit offset representation. But this does lose the explicit array bounds information from the type – and losing it is intentional.

LoopInterchange computes DependenceInfo itself, not the via pass manager, so it has full control over when (and whether) it gets computed.