summaryrefslogtreecommitdiff
path: root/willow/lib/IR/Instruction.cpp
blob: 587736ddfe396ae30588ccabe5057680d0816459 (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
35
36
37
38
#include <willow/IR/Instruction.h>

namespace willow {

bool Instruction::isTerminatorOp(Opcode op) {
  using enum Opcode;
  switch (op) {
  case Jmp:
  case Br:
  case Call:
  case Ret:
    return true;
  case Add:
  case Mul:
  case Sub:
  case Div:
  case Mod:
  case Shl:
  case Shr:
  case Ashl:
  case Ashr:
  case Eq:
  case Lt:
  case Gt:
  case Le:
  case Ge:
  case And:
  case Or:
  case Not:
  case Phi:
  case Alloca:
    return false;
  }
}

Successors Instruction::succs();

}; // namespace willow