Revert " [LoongArch][ISel] Check the number of sign bits in `PatGprGpr_32` (#107432)"
[llvm-project.git] / llvm / lib / Analysis / StructuralHash.cpp
blob24985f0a9d3147648c65ec05fa7a38e4b55fa8ef
1 //===- StructuralHash.cpp - Function Hash Printing ------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file defines the StructuralHashPrinterPass which is used to show
10 // the structural hash of all functions in a module and the module itself.
12 //===----------------------------------------------------------------------===//
14 #include "llvm/Analysis/StructuralHash.h"
15 #include "llvm/IR/Module.h"
16 #include "llvm/IR/StructuralHash.h"
17 #include "llvm/Support/CommandLine.h"
19 using namespace llvm;
21 PreservedAnalyses StructuralHashPrinterPass::run(Module &M,
22 ModuleAnalysisManager &MAM) {
23 OS << "Module Hash: "
24 << Twine::utohexstr(StructuralHash(M, EnableDetailedStructuralHash))
25 << "\n";
26 for (Function &F : M) {
27 if (F.isDeclaration())
28 continue;
29 OS << "Function " << F.getName() << " Hash: "
30 << Twine::utohexstr(StructuralHash(F, EnableDetailedStructuralHash))
31 << "\n";
33 return PreservedAnalyses::all();