[mlir][llvm] Fix TBAA verfication crash
authorChristian Ulmann <christian.ulmann@nextsilicon.com>
Fri, 10 Feb 2023 07:21:46 +0000 (08:21 +0100)
committerChristian Ulmann <christian.ulmann@nextsilicon.com>
Fri, 10 Feb 2023 07:38:14 +0000 (08:38 +0100)
commitfc2c791e89cd10ab9225421f215c2267e832977f
tree51bee8794efc952b31fddfaa6a507a557f390aa5
parent70924673af680303d64e540d7767c0eeda5217fc
[mlir][llvm] Fix TBAA verfication crash

This commit fixes a crash of the TBAA verification that happened due to
accessing memory through invalid pointers. A DenseMap does not guarantee
that pointers to its elements remain valid after additional elements
are inserted.

A testcase that caused this crash had more than 100 TBAA metadata
operations and thus no test is added. Instead, there is now an assertion
that ensures that the graph class is used correctly.

Reviewed By: vzakhari

Differential Revision: https://reviews.llvm.org/D143653
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp