mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-24 13:18:17 +00:00
The current Intel Atom microarchitecture has a feature whereby when a function
returns early then it is slightly faster to execute a sequence of NOP instructions to wait until the return address is ready, as opposed to simply stalling on the ret instruction until the return address is ready. When compiling for X86 Atom only, this patch will run a pass, called "X86PadShortFunction" which will add NOP instructions where less than four cycles elapse between function entry and return. It includes tests. Patch by Andy Zhang. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171524 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -190,6 +190,10 @@ bool X86PassConfig::addPreEmitPass() {
|
||||
addPass(createX86IssueVZeroUpperPass());
|
||||
ShouldPrint = true;
|
||||
}
|
||||
if (getX86Subtarget().padShortFunctions()){
|
||||
addPass(createX86PadShortFunctions());
|
||||
ShouldPrint = true;
|
||||
}
|
||||
|
||||
return ShouldPrint;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user