ScopeNestedCFG.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // ScopeNestedCFG.cpp //
  4. // Copyright (C) Microsoft Corporation. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. // Pass that converts a reducible CFG into scope-nested CFG. //
  9. // The pass expects that the following passes have been run //
  10. // right before the pass is invoked: //
  11. // -simplifycfg //
  12. // -loop-simplify //
  13. // -reg2mem_hlsl //
  14. // //
  15. ///////////////////////////////////////////////////////////////////////////////
  16. #pragma once
  17. namespace llvm {
  18. class Module;
  19. class Function;
  20. class PassRegistry;
  21. class FunctionPass;
  22. llvm::FunctionPass *createScopeNestedCFGPass();
  23. void initializeScopeNestedCFGPass(llvm::PassRegistry&);
  24. llvm::FunctionPass *createLoopSimplifyFunctionPass();
  25. void initializeLoopSimplifyFunctionPass(llvm::PassRegistry&);
  26. enum class BranchKind {
  27. Invalid = 0,
  28. IfBegin,
  29. IfEnd,
  30. IfNoEnd,
  31. SwitchBegin,
  32. SwitchEnd,
  33. SwitchNoEnd,
  34. SwitchBreak,
  35. LoopBegin,
  36. LoopExit,
  37. LoopNoEnd,
  38. LoopBreak,
  39. LoopContinue,
  40. LoopBackEdge,
  41. };
  42. }