This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <unistd.h> | |
#ifndef BUFSIZ | |
#define BUFSIZ 1024 | |
#endif | |
int main(int argc, char *argv[]) { | |
if (argc < 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma D option quiet | |
pid$target::malloc:entry { | |
@size[probefunc] = sum(arg0); | |
@totalsize = sum(arg0); | |
@calls[probefunc] = count(); | |
@totalcalls = count(); | |
} | |
pid$target::calloc:entry { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <assert.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
const char *boyer_moore_horspool(const char *h, size_t hlen, | |
const char *n, size_t nlen) { | |
const unsigned char *haystack = (const unsigned char *)h; | |
const unsigned char *needle = (const unsigned char *)n; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#ifdef __SSE2__ | |
#include <emmintrin.h> | |
#endif | |
static const char *SkipToNewline(const char *CurPtr, const char *BufferEnd) { | |
unsigned char C = *CurPtr; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
commit 99ea7d9b3d64c51694b8cc35c6bd25b4945ab0c2 | |
Author: Benjamin Kramer <[email protected]> | |
Date: Wed Apr 25 12:39:50 2012 +0200 | |
X86: Turn cmovs into branches when profitable. | |
This came up when a change in block placement formed a cmov and slowed down a | |
hot loop by 50%: | |
ucomisd (%rdi), %xmm0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Analysis/InlineCost.cpp b/lib/Analysis/InlineCost.cpp | |
index a6bf4a8..8e7377d 100644 | |
--- a/lib/Analysis/InlineCost.cpp | |
+++ b/lib/Analysis/InlineCost.cpp | |
@@ -797,9 +797,30 @@ bool CallAnalyzer::analyzeCall(CallSite CS) { | |
FiftyPercentVectorBonus = Threshold; | |
TenPercentVectorBonus = Threshold / 2; | |
- // Subtract off one instruction per call argument as those will be free after | |
- // inlining. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-W | |
-Wextra | |
-Wmissing-field-initializers | |
-Wignored-qualifiers | |
-Winitializer-overrides | |
-Wsemicolon-before-method-body | |
-Wmissing-method-return-type | |
-Wsign-compare | |
-Wunused-parameter | |
-W#pragma-messages |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/tools/scan-build/ccc-analyzer b/tools/scan-build/ccc-analyzer | |
index 216dc9d..51f5097 100755 | |
--- a/tools/scan-build/ccc-analyzer | |
+++ b/tools/scan-build/ccc-analyzer | |
@@ -569,6 +569,12 @@ foreach (my $i = 0; $i < scalar(@ARGV); ++$i) { | |
push @CompileOpts,$Arg; | |
next; | |
} | |
+ | |
+ if ($Arg =~ /^-stdlib=/) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Target/X86/X86InstrCompiler.td b/lib/Target/X86/X86InstrCompiler.td | |
index f387962..29ce597 100644 | |
--- a/lib/Target/X86/X86InstrCompiler.td | |
+++ b/lib/Target/X86/X86InstrCompiler.td | |
@@ -1089,6 +1089,7 @@ multiclass CMOVmr<PatLeaf InvertedCond, Instruction Inst16, Instruction Inst32, | |
(Inst64 GR64:$src2, addr:$src1)>; | |
} | |
+let Predicates = [HasCMov] in { | |
defm : CMOVmr<X86_COND_B , CMOVAE16rm, CMOVAE32rm, CMOVAE64rm>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* clang depgraph.c -o depgraph -I tools/clang/include -lclang */ | |
#include "clang-c/Index.h" | |
#include <stdio.h> | |
static enum CXChildVisitResult | |
visitor(CXCursor cursor, CXCursor parent, CXClientData client_data) { | |
enum CXCursorKind kind = clang_getCursorKind(cursor); | |
CXFile tu_file = (CXFile *)client_data; | |
CXFile in_file, from_file; | |
unsigned line, column, offset; |