This patch implements the analysis state classes needed for sparse data-flow analysis and implements a dead-code analysis using those states to determine liveness of blocks, control-flow edges, region predecessors, and function callsites. Depends on D126751 Reviewed By: rriddle, phisiart Differential Revision: https://reviews.llvm.org/D127064
23 lines
792 B
C++
23 lines
792 B
C++
//===- ConstantPropagationAnalysis.cpp - Constant propagation analysis ----===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#include "mlir/Analysis/DataFlow/ConstantPropagationAnalysis.h"
|
|
|
|
using namespace mlir;
|
|
using namespace mlir::dataflow;
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
// ConstantValue
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
void ConstantValue::print(raw_ostream &os) const {
|
|
if (constant)
|
|
return constant.print(os);
|
|
os << "<NO VALUE>";
|
|
}
|