InjectTLIMappings.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #include "llvm/Pass.h"
  23. namespace llvm {
  24. class Function;
  25. class InjectTLIMappings : public PassInfoMixin<InjectTLIMappings> {
  26. public:
  27. PreservedAnalyses run(Function &F, FunctionAnalysisManager &AM);
  28. };
  29. // Legacy pass
  30. class InjectTLIMappingsLegacy : public FunctionPass {
  31. public:
  32. static char ID;
  33. InjectTLIMappingsLegacy() : FunctionPass(ID) {
  34. initializeInjectTLIMappingsLegacyPass(*PassRegistry::getPassRegistry());
  35. }
  36. void getAnalysisUsage(AnalysisUsage &AU) const override;
  37. bool runOnFunction(Function &F) override;
  38. };
  39. } // End namespace llvm
  40. #endif // LLVM_TRANSFORMS_UTILS_INJECTTLIMAPPINGS_H
  41. #ifdef __GNUC__
  42. #pragma GCC diagnostic pop
  43. #endif