[llvm] [llvm-diff] Also diff alloca's allocated type and alignment (PR #84781)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 14 09:25:05 PDT 2024


YanWQ-monad wrote:

TL;DR: added a function `isSameType(Type *TL, Type *TR)` to check whether `TL` on the left side and `TR` on the right side are structural equivalence. It recursively compares the inner elements of `StructType`, `VectorType`, and `ArrayType`, and caches the result in `IsSameTypes`.

In `diff(Instruction *L, Instruction *R, .....)` function, for type-related instructions (`load`, gep, `alloca`), check their type equivalence using `isSameType`; and for other instructions, it calls `hasSameSpecialState` to compare other non-operand data.

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


More information about the llvm-commits mailing list