LLVM: lib/Target/WebAssembly/WebAssemblySortRegion.cpp Source File (original) (raw)

Go to the documentation of this file.

4

5using namespace llvm;

7

8namespace llvm {

10template <>

14}

15}

16

18 const auto *ML = MLI.getLoopFor(MBB);

19 const auto *WE = WEI.getExceptionFor(MBB);

20 if (ML && !WE)

21 return nullptr;

22

23

24

25

26

27

28

29 if ((ML && !WE) || (ML && WE && WE->contains(ML->getHeader()))) {

30

31 auto [It, Inserted] = LoopMap.try_emplace(ML);

32 if (Inserted)

33 It->second = std::make_unique<ConcreteSortRegion>(ML);

34 return It->second.get();

35 } else {

36

37 auto [It, Inserted] = ExceptionMap.try_emplace(WE);

38 if (Inserted)

39 It->second =

40 std::make_unique<ConcreteSortRegion>(WE);

41 return It->second.get();

42 }

43}

44

46 if (R->isLoop())

47 return getBottom(MLI.getLoopFor(R->getHeader()));

48 else

49 return getBottom(WEI.getExceptionFor(R->getHeader()));

50}

51

56 Bottom = MBB;

57

58

59

60

61

62

63 if (MBB->isEHPad()) {

66 Bottom = ExBottom;

67 }

68 }

69 return Bottom;

70}

71

76 Bottom = MBB;

77 return Bottom;

78}

This file implements WebAssemblyException information analysis.

This file implements regions used in CFGSort and CFGStackify.

int getNumber() const

MachineBasicBlocks are uniquely numbered at the function level, unless they're not in a MachineFuncti...

iterator_range< block_iterator > blocks() const

MachineBasicBlock * getHeader() const

bool isLoop() const override

const SortRegion * getRegionFor(const MachineBasicBlock *MBB)

Definition WebAssemblySortRegion.cpp:17

MachineBasicBlock * getBottom(const SortRegion *R)

Definition WebAssemblySortRegion.cpp:45

This is an optimization pass for GlobalISel generic memory operations.