-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[X86] Do not ignore AlwaysInline when determining if inlining is worth it #87825
base: main
Are you sure you want to change the base?
Conversation
@llvm/pr-subscribers-backend-x86 Author: AtariDreams (AtariDreams) ChangesAlwaysInline parameter would be ignored if the outlining exceeded the threshold or simply was not aligned enough. Full diff: https://github.com/llvm/llvm-project/pull/87825.diff 1 Files Affected:
diff --git a/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp b/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
index 7c630a2b0da080..d1e7c9046fdc17 100644
--- a/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
+++ b/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
@@ -66,8 +66,10 @@ SDValue X86SelectionDAGInfo::EmitTargetCodeForMemset(
// If not DWORD aligned or size is more than the threshold, call the library.
// The libc version is likely to be faster for these cases. It can use the
// address value and run time information about the CPU.
- if (Alignment < Align(4) || !ConstantSize ||
- ConstantSize->getZExtValue() > Subtarget.getMaxInlineSizeThreshold())
+ if (!ConstantSize ||
+ (!AlwaysInline &&
+ (Alignment < Align(4) ||
+ ConstantSize->getZExtValue() > Subtarget.getMaxInlineSizeThreshold())))
return SDValue();
uint64_t SizeVal = ConstantSize->getZExtValue();
|
e7420ba
to
7fa23af
Compare
7fa23af
to
0e8ddef
Compare
return SDValue(); | ||
|
||
uint64_t SizeVal = ConstantSize->getZExtValue(); | ||
if (!AlwaysInline && |
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.
AlwaysInline
is taken care in https://github.com/llvm/llvm-project/blob/main/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp#L8260 anyway.
I'm not sure if stosb
is better than sequential stores.
0e8ddef
to
cd8b5ea
Compare
…h it AlwaysInline parameter would be ignored if the outlining exceeded the threshold or simply was not aligned enough.
cd8b5ea
to
6b5fe17
Compare
AlwaysInline parameter would be ignored if the outlining exceeded the threshold or simply was not aligned enough.