|
42 | 42 | #include "llvm/IR/Module.h"
|
43 | 43 | #include "llvm/IR/PassManager.h"
|
44 | 44 | #include "llvm/IR/PatternMatch.h"
|
| 45 | +#include "llvm/IR/RuntimeLibcalls.h" |
45 | 46 | #include "llvm/IR/Type.h"
|
46 | 47 | #include "llvm/IR/User.h"
|
47 | 48 | #include "llvm/IR/Value.h"
|
@@ -104,9 +105,6 @@ static cl::opt<bool> HexagonVolatileMemcpy(
|
104 | 105 | static cl::opt<unsigned> SimplifyLimit("hlir-simplify-limit", cl::init(10000),
|
105 | 106 | cl::Hidden, cl::desc("Maximum number of simplification steps in HLIR"));
|
106 | 107 |
|
107 |
| -static const char *HexagonVolatileMemcpyName |
108 |
| - = "hexagon_memcpy_forward_vp4cp4n2"; |
109 |
| - |
110 | 108 | namespace {
|
111 | 109 |
|
112 | 110 | class HexagonLoopIdiomRecognize {
|
@@ -2246,6 +2244,11 @@ bool HexagonLoopIdiomRecognize::processCopyingStore(Loop *CurLoop,
|
2246 | 2244 | Type *PtrTy = PointerType::get(Ctx, 0);
|
2247 | 2245 | Type *VoidTy = Type::getVoidTy(Ctx);
|
2248 | 2246 | Module *M = Func->getParent();
|
| 2247 | + |
| 2248 | + // FIXME: This should check if the call is supported |
| 2249 | + StringRef HexagonVolatileMemcpyName = |
| 2250 | + RTLIB::RuntimeLibcallsInfo::getLibcallImplName( |
| 2251 | + RTLIB::impl_hexagon_memcpy_forward_vp4cp4n2); |
2249 | 2252 | FunctionCallee Fn = M->getOrInsertFunction(
|
2250 | 2253 | HexagonVolatileMemcpyName, VoidTy, PtrTy, PtrTy, Int32Ty);
|
2251 | 2254 |
|
|
0 commit comments