[llvm-branch-commits] [llvm-branch] r322681 - Merging r322223:
Hans Wennborg via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jan 17 08:24:35 PST 2018
Author: hans
Date: Wed Jan 17 08:24:35 2018
New Revision: 322681
URL: http://llvm.org/viewvc/llvm-project?rev=322681&view=rev
Log:
Merging r322223:
------------------------------------------------------------------------
r322223 | matze | 2018-01-10 12:49:57 -0800 (Wed, 10 Jan 2018) | 5 lines
TargetLoweringBase: The ios simulator has no bzero function.
Make sure I really get back to the beahvior before my rewrite in r321035
which turned out not to be completely NFC as I changed the behavior for
the ios simulator environment.
------------------------------------------------------------------------
Modified:
llvm/branches/release_60/ (props changed)
llvm/branches/release_60/lib/CodeGen/TargetLoweringBase.cpp
llvm/branches/release_60/test/CodeGen/X86/darwin-bzero.ll
Propchange: llvm/branches/release_60/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Jan 17 08:24:35 2018
@@ -1,3 +1,3 @@
/llvm/branches/Apple/Pertwee:110850,110961
/llvm/branches/type-system-rewrite:133420-134817
-/llvm/trunk:155241,321789,321791,321862,321870,321872,321980,321991,321993-321994,322056,322103,322106,322272,322473,322623
+/llvm/trunk:155241,321789,321791,321862,321870,321872,321980,321991,321993-321994,322056,322103,322106,322223,322272,322473,322623
Modified: llvm/branches/release_60/lib/CodeGen/TargetLoweringBase.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/lib/CodeGen/TargetLoweringBase.cpp?rev=322681&r1=322680&r2=322681&view=diff
==============================================================================
--- llvm/branches/release_60/lib/CodeGen/TargetLoweringBase.cpp (original)
+++ llvm/branches/release_60/lib/CodeGen/TargetLoweringBase.cpp Wed Jan 17 08:24:35 2018
@@ -132,9 +132,18 @@ void TargetLoweringBase::InitLibcalls(co
setLibcallName(RTLIB::FPEXT_F16_F32, "__extendhfsf2");
setLibcallName(RTLIB::FPROUND_F32_F16, "__truncsfhf2");
- // Darwin 10 and higher has an optimized __bzero.
- if (!TT.isMacOSX() || !TT.isMacOSXVersionLT(10, 6) || TT.isArch64Bit()) {
- setLibcallName(RTLIB::BZERO, TT.isAArch64() ? "bzero" : "__bzero");
+ // Some darwins have an optimized __bzero/bzero function.
+ switch (TT.getArch()) {
+ case Triple::x86:
+ case Triple::x86_64:
+ if (TT.isMacOSX() && !TT.isMacOSXVersionLT(10, 6))
+ setLibcallName(RTLIB::BZERO, "__bzero");
+ break;
+ case Triple::aarch64:
+ setLibcallName(RTLIB::BZERO, "bzero");
+ break;
+ default:
+ break;
}
if (darwinHasSinCos(TT)) {
Modified: llvm/branches/release_60/test/CodeGen/X86/darwin-bzero.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_60/test/CodeGen/X86/darwin-bzero.ll?rev=322681&r1=322680&r2=322681&view=diff
==============================================================================
--- llvm/branches/release_60/test/CodeGen/X86/darwin-bzero.ll (original)
+++ llvm/branches/release_60/test/CodeGen/X86/darwin-bzero.ll Wed Jan 17 08:24:35 2018
@@ -1,10 +1,13 @@
-; RUN: llc < %s -mtriple=i386-apple-darwin10 | FileCheck %s
-; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck %s
+; RUN: llc < %s -mtriple=i386-apple-darwin10 | FileCheck -check-prefixes=CHECK,BZERO %s
+; RUN: llc < %s -mtriple=x86_64-apple-darwin10 | FileCheck -check-prefixes=CHECK,BZERO %s
+; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck -check-prefixes=CHECK,NOBZERO %s
+; RUN: llc < %s -mtriple=x86_64-apple-ios10.0-simulator | FileCheck -check-prefixes=CHECK,NOBZERO %s
declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1) nounwind
; CHECK-LABEL: foo:
-; CHECK: {{calll|callq}} ___bzero
+; BZERO: {{calll|callq}} ___bzero
+; NOBZERO-NOT: bzero
define void @foo(i8* %p, i32 %len) {
call void @llvm.memset.p0i8.i32(i8* %p, i8 0, i32 %len, i32 1, i1 false)
ret void
More information about the llvm-branch-commits
mailing list