[llvm] [TBAA] Recover !tbaa for a memcpy of struct with same type fields (PR #214116)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 17 13:53:20 PDT 2026
================
@@ -761,6 +761,22 @@ static bool getTBAAStructFieldAsInt64(const MDOperand &Op, uint64_t &Out) {
return true;
}
+// Return true if Tag is a struct-path TBAA access tag: two type nodes (base
+// and access) followed by constant integer fields (offset, and an optional
+// size and/or immutability flag). A !tbaa.struct field operand need not be
+// such a tag, so validate before reusing it as !tbaa.
+static bool isValidTBAAAccessTag(const MDNode *Tag) {
----------------
fhahn wrote:
Hmm, if we cannot re-use the full logic from the verifier easily, then it is better to keep the logc in `TBAA.cpp`. It looks like it also contains a `isNewFormatTypeNode` which we can re-use. Also looks like this is something that may be good to unify with the verifier in a follow-up
https://github.com/llvm/llvm-project/pull/214116
More information about the llvm-commits
mailing list