summaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Vectorize/SandboxVectorizer/InstrMaps.cpp
blob: 37f1ec450f2ebd1a20db16a757debd16cc0752ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//===- InstructionMaps.cpp - Maps scalars to vectors and reverse ----------===//
//
// 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 "llvm/Transforms/Vectorize/SandboxVectorizer/InstrMaps.h"
#include "llvm/Support/Debug.h"
#include "llvm/Transforms/Vectorize/SandboxVectorizer/Legality.h"

namespace llvm::sandboxir {

#ifndef NDEBUG
void Action::print(raw_ostream &OS) const {
  OS << Idx << ". " << *LegalityRes << " Depth:" << Depth << "\n";
  OS.indent(2) << "Bndl:\n";
  for (Value *V : Bndl)
    OS.indent(4) << *V << "\n";
  OS.indent(2) << "UserBndl:\n";
  for (Value *V : UserBndl)
    OS.indent(4) << *V << "\n";
}

void Action::dump() const { print(dbgs()); }

void InstrMaps::dump() const {
  print(dbgs());
  dbgs() << "\n";
}
#endif // NDEBUG

} // namespace llvm::sandboxir