[mlir] UnsignedWhenEquivalent ignore dead code
authorJeff Niu <jeff@modular.com>
Tue, 6 Dec 2022 04:00:38 +0000 (20:00 -0800)
committerJeff Niu <jeff@modular.com>
Tue, 6 Dec 2022 04:38:44 +0000 (20:38 -0800)
commit34535801d609923252237cd475606506a4ad244f
treed5e2e5d348d38494aa72192f88fe1e18aed03ed3
parent0f06da6412b83754b274f4b1edf2e3c766724e2e
[mlir] UnsignedWhenEquivalent ignore dead code

The pass was not checking for uninitialized states due to dead code.
This patch also makes LLVMFuncOp correctly return a null body when it is
external.

Fixes #58807

Depends on D139388

Reviewed By: rriddle

Differential Revision: https://reviews.llvm.org/D139389
mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
mlir/lib/Dialect/Arith/Transforms/UnsignedWhenEquivalent.cpp
mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
mlir/test/Dialect/Arith/unsigned-when-equivalent.mlir
mlir/test/Dialect/LLVMIR/callgraph.mlir