DxilSimplify.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //===-- DxilSimplify.h - Simplify Dxil operations ------*- C++ -*-===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. // Copyright (C) Microsoft Corporation. All rights reserved.
  9. //===----------------------------------------------------------------------===//
  10. //
  11. // This file declares routines for simplify dxil intrinsics when some operands
  12. // are constants.
  13. //
  14. // We hook into the llvm::SimplifyInstruction so the function
  15. // interfaces are dictated by what llvm provides.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_ANALYSIS_HLSLDXILSIMPLIFY_H
  19. #define LLVM_ANALYSIS_HLSLDXILSIMPLIFY_H
  20. #include "llvm/ADT/ArrayRef.h"
  21. namespace llvm {
  22. class Function;
  23. class Instruction;
  24. class Value;
  25. } // namespace llvm
  26. namespace hlsl {
  27. /// \brief Given a function and set of arguments, see if we can fold the
  28. /// result as dxil operation.
  29. ///
  30. /// If this call could not be simplified returns null.
  31. llvm::Value *SimplifyDxilCall(llvm::Function *F,
  32. llvm::ArrayRef<llvm::Value *> Args,
  33. llvm::Instruction *I);
  34. /// CanSimplify
  35. /// Return true on dxil operation function which can be simplified.
  36. bool CanSimplify(const llvm::Function *F);
  37. } // namespace hlsl
  38. #endif