diff options
author | Dan Gohman <gohman@apple.com> | 2008-04-01 20:38:36 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-04-01 20:38:36 +0000 |
commit | 68d599df37218452acd5a680d5360d3caaa1623c (patch) | |
tree | 86b517d4f8bae9d4fc95579d1da720e78cf78270 /lib/Target/X86/X86Subtarget.cpp | |
parent | b6d5b1439047609c050576f3dc52b722e76bd30b (diff) |
Speculatively micro-optimize memory-zeroing calls on Darwin 10.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49048 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86/X86Subtarget.cpp')
-rw-r--r-- | lib/Target/X86/X86Subtarget.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Target/X86/X86Subtarget.cpp b/lib/Target/X86/X86Subtarget.cpp index 483b8a4fd9..56bb7acdb0 100644 --- a/lib/Target/X86/X86Subtarget.cpp +++ b/lib/Target/X86/X86Subtarget.cpp @@ -53,6 +53,20 @@ bool X86Subtarget::GVRequiresExtraLoad(const GlobalValue* GV, return false; } +/// This function returns the name of a function which has an interface +/// like the non-standard bzero function, if such a function exists on +/// the current subtarget and it is considered prefereable over +/// memset with zero passed as the second argument. Otherwise it +/// returns null. +const char *X86Subtarget::getBZeroEntry() const { + + // Darwin 10 has a __bzero entry point for this purpose. + if (getDarwinVers() >= 10) + return "__bzero"; + + return 0; +} + /// GetCpuIDAndInfo - Execute the specified cpuid and return the 4 values in the /// specified arguments. If we can't run cpuid on the host, return true. bool X86::GetCpuIDAndInfo(unsigned value, unsigned *rEAX, unsigned *rEBX, |