[PATCH] D104503: [SCEV] Don't require dominance ordering of add/mul/min/max expressions
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 21 14:14:55 PDT 2021
efriedma added a comment.
> p1 and p2 are not in a dominance relationship, but an AA query between them seems meaningful
In general, an alias() query involves two input pointers/sizes, and a position in the CFG. But in the LLVM API, the "position" is implicit. The easiest way to define this position is "any position dominated by both pointers". Anything else gets more complicated. Consider, for example:
if (cond) {
a[getc(file1)]++;
} else
a[getc(file2)]++;
}
Do these accesses alias? What does it even mean for them to alias?
---
For your example with a GEP after an if statement, there's a sort of "obvious" rule: you can solve the position issue by implicitly hoisting the GEP before the if statement. I guess we could define some sort of "extended" dominance relationship that includes some amount of hoisting. But it's not clear how the caller would know it's dealing with a value that can be hoisted.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D104503/new/
https://reviews.llvm.org/D104503
More information about the llvm-commits
mailing list