-
Notifications
You must be signed in to change notification settings - Fork 15.2k
Hexagon: Add runtime libcall entries for volatile memcpy call #156561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hexagon: Add runtime libcall entries for volatile memcpy call #156561
Conversation
@llvm/pr-subscribers-llvm-ir @llvm/pr-subscribers-backend-hexagon Author: Matt Arsenault (arsenm) ChangesThis pass currently doesn't have TargetLoweringInfo, but technically Full diff: https://github.com/llvm/llvm-project/pull/156561.diff 2 Files Affected:
diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.td b/llvm/include/llvm/IR/RuntimeLibcalls.td
index 24ea92cc6865d..c909ec6c660b7 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.td
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.td
@@ -446,6 +446,7 @@ def AEABI_MEMCLR8 : RuntimeLibcall;
// Hexagon calls
def HEXAGON_MEMCPY_LIKELY_ALIGNED_MIN32BYTES_MULT8BYTES : RuntimeLibcall;
+def HEXAGON_VOLATILE_MEMCPY : RuntimeLibcall;
// XCore calls
def MEMCPY_ALIGN_4 : RuntimeLibcall;
@@ -1875,6 +1876,8 @@ def __hexagon_fast2_sqrtdf2 : RuntimeLibcallImpl<FAST_SQRT_F64>;
def __hexagon_memcpy_likely_aligned_min32bytes_mult8bytes
: RuntimeLibcallImpl<HEXAGON_MEMCPY_LIKELY_ALIGNED_MIN32BYTES_MULT8BYTES>;
+
+def hexagon_memcpy_forward_vp4cp4n2 : RuntimeLibcallImpl<HEXAGON_VOLATILE_MEMCPY>;
}
def isHexagon : RuntimeLibcallPredicate<"TT.getArch() == Triple::hexagon">;
diff --git a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
index 72575f2560a34..c6e643f9ea40f 100644
--- a/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonLoopIdiomRecognition.cpp
@@ -42,6 +42,7 @@
#include "llvm/IR/Module.h"
#include "llvm/IR/PassManager.h"
#include "llvm/IR/PatternMatch.h"
+#include "llvm/IR/RuntimeLibcalls.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/User.h"
#include "llvm/IR/Value.h"
@@ -2246,6 +2247,11 @@ bool HexagonLoopIdiomRecognize::processCopyingStore(Loop *CurLoop,
Type *PtrTy = PointerType::get(Ctx, 0);
Type *VoidTy = Type::getVoidTy(Ctx);
Module *M = Func->getParent();
+
+ // FIXME: This should check if the call is supported
+ StringRef HexagonVolatileMemcpyName =
+ RuntimeLibcallsInfo::getLibcallImplName(
+ RTLIB::impl_hexagon_memcpy_forward_vp4cp4n2);
FunctionCallee Fn = M->getOrInsertFunction(
HexagonVolatileMemcpyName, VoidTy, PtrTy, PtrTy, Int32Ty);
|
@iajbar can you help w/this pull req? |
d14d840
to
867cbd4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @arsenm
This pass currently doesn't have TargetLoweringInfo, but technically it should verify the call is available from a future RuntimeLibcallsInfo analysis.
867cbd4
to
25a4489
Compare
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/163/builds/26035 Here is the relevant piece of the build log for the reference
|
This pass currently doesn't have TargetLoweringInfo, but technically
it should verify the call is available from a future RuntimeLibcallsInfo
analysis.