[llvm] [DAGCombiner] Fix mayAlias not accounting for scalable MMOs with offsets (PR #90573)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 02:48:12 PDT 2024


================
@@ -28113,7 +28113,10 @@ bool DAGCombiner::mayAlias(SDNode *Op0, SDNode *Op1) const {
 #endif
 
   if (UseAA && AA && MUC0.MMO->getValue() && MUC1.MMO->getValue() &&
-      Size0.hasValue() && Size1.hasValue()) {
+      Size0.hasValue() && Size1.hasValue() &&
+      // Can't represent a scalable size + fixed offset in LocationSize
+      !(Size0.isScalable() && SrcValOffset0 != 0) &&
+      !(Size1.isScalable() && SrcValOffset1 != 0)) {
----------------
arsenm wrote:

```suggestion
      (!Size0.isScalable() || SrcValOffset0 == 0) &&
      (!Size1.isScalable() || SrcValOffset1 == 0)) {
```

https://github.com/llvm/llvm-project/pull/90573


More information about the llvm-commits mailing list