InjectTLIMappings.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===- InjectTLIMAppings.h - TLI to VFABI attribute injection ------------===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. //
  14. // Populates the VFABI attribute with the scalar-to-vector mappings
  15. // from the TargetLibraryInfo.
  16. //
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_TRANSFORMS_UTILS_INJECTTLIMAPPINGS_H
  19. #define LLVM_TRANSFORMS_UTILS_INJECTTLIMAPPINGS_H
  20. #include "llvm/IR/PassManager.h"
  21. #include "llvm/InitializePasses.h"
  22. namespace llvm {
  23. class InjectTLIMappings : public PassInfoMixin<InjectTLIMappings> {
  24. public:
  25. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
  26. };
  27. // Legacy pass
  28. class InjectTLIMappingsLegacy : public FunctionPass {
  29. public:
  30. static char ID;
  31. InjectTLIMappingsLegacy() : FunctionPass(ID) {
  32. initializeInjectTLIMappingsLegacyPass(*PassRegistry::getPassRegistry());
  33. }
  34. void getAnalysisUsage(AnalysisUsage &AU) const override;
  35. bool runOnFunction(Function &F) override;
  36. };
  37. } // End namespace llvm
  38. #endif // LLVM_TRANSFORMS_UTILS_INJECTTLIMAPPINGS_H
  39. #ifdef __GNUC__
  40. #pragma GCC diagnostic pop
  41. #endif