[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / llvm / lib / Analysis / StructuralHash.cpp
blob244ed5d55f3f810191966d465e7512e8a62e89a6
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/StructuralHash.h"
16 #include "llvm/Support/CommandLine.h"
18 using namespace llvm;
20 PreservedAnalyses StructuralHashPrinterPass::run(Module &M,
21 ModuleAnalysisManager &MAM) {
22 OS << "Module Hash: "
23 << Twine::utohexstr(StructuralHash(M, EnableDetailedStructuralHash))
24 << "\n";
25 for (Function &F : M) {
26 if (F.isDeclaration())
27 continue;
28 OS << "Function " << F.getName() << " Hash: "
29 << Twine::utohexstr(StructuralHash(F, EnableDetailedStructuralHash))
30 << "\n";
32 return PreservedAnalyses::all();