Node::adr_type is ambiguous. Sometimes, it refers to the memory the node consumes, such as in the case of LoadNode. In other cases, it may refer to the memory the node produces, such as in SafeNodeNode::adr_type. There are some issues that arise:
- It is easy to misuse this method, and get a result that is not actually what you expect. It is lucky for us that most nodes produce the same memory as they consume, so this is not too severe, but I can find some places where what we use seem incorrect.
- Anti-dependency computation is tricky. Generally, we need to compute anti-dependency for all memory consumers, that means we need to do it for stores, too. The reason we do not usually have to is that the store kills the memory, so for normal programs, 2 stores cannot both kill the same memory. This, however, is only correct if the store kills the whole memory it consumes. For example, if we have:
char[] a;
byte[] b = StrCompressedCopy(a);
Store(&a[1], 2);
Then, we have to construct an anti-dependency edge between StrCompress and Store. However, this is not the case, as we do not compute anti-dependency of StrCompressedCopy both during loop opts and final scheduling.
- It is easy to misuse this method, and get a result that is not actually what you expect. It is lucky for us that most nodes produce the same memory as they consume, so this is not too severe, but I can find some places where what we use seem incorrect.
- Anti-dependency computation is tricky. Generally, we need to compute anti-dependency for all memory consumers, that means we need to do it for stores, too. The reason we do not usually have to is that the store kills the memory, so for normal programs, 2 stores cannot both kill the same memory. This, however, is only correct if the store kills the whole memory it consumes. For example, if we have:
char[] a;
byte[] b = StrCompressedCopy(a);
Store(&a[1], 2);
Then, we have to construct an anti-dependency edge between StrCompress and Store. However, this is not the case, as we do not compute anti-dependency of StrCompressedCopy both during loop opts and final scheduling.
- links to
-
Review(master)
openjdk/jdk/28570