Skip to content

Merge branch 'amd-master' into amd-common #13

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

Merged
merged 80 commits into from
Sep 26, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
80 commits
Select commit Hold shift + click to select a range
f8d0897
[RegisterBank] Mark the dump method with LLVM_DUMP_METHOD.
Sep 23, 2016
4151a97
[RegBankSelect] Use DEBUG_TYPE instead of repeating the name of the pass
Sep 23, 2016
5c7b0b1
BitcodeReader: Deduplicate code. NFC.
pcc Sep 23, 2016
abd02b3
ScheduleDAG: Match enum names when printing sdep kinds
MatzeB Sep 23, 2016
c81278e
[RegisterBankInfo] Add statistics for dynamic partial mappings.
Sep 23, 2016
76cc1a9
[ResetMachineFunction] Add statistic on the number of reset functions.
Sep 23, 2016
f8e3a51
[ResetMachineFunction] Populate the comments in the header of the file.
Sep 23, 2016
c5ddf50
[TLI] isdigit / isascii / toascii param type should match return type…
rotateright Sep 23, 2016
c36f315
[llvm-cov] Minor cleanup. NFC.
vedantk Sep 23, 2016
fd06635
[llvm-cov] Get rid of all invalid filename references
vedantk Sep 23, 2016
daacf3c
[llvm-cov] Filter away source files that aren't in the coverage mapping
vedantk Sep 23, 2016
85fa818
[MC] Support .dcb directives in assembler parser
petrhosek Sep 23, 2016
a6754db
[libFuzzer] reset Counters (trace-pc-guard) before every run
kcc Sep 23, 2016
3de4fb3
[llvm-cov] Factor out logic to remove unmapped inputs (NFC)
vedantk Sep 23, 2016
5438741
[Coverage] Clarify a function contract (NFC)
vedantk Sep 23, 2016
468ae9f
[gold] Split plugin options controlling ThinLTO and codegen parallelism.
teresajohnson Sep 23, 2016
b5dbd9f
[libFuzzer] first steps in adding a proper automated test suite based…
kcc Sep 23, 2016
dc7e3f0
[AMDGPU] Fix for bz30427: wrong MTBUF encoding on VI
vpykhtin Sep 23, 2016
91d99c6
LTO: Simplify caching interface.
pcc Sep 23, 2016
a92ff23
llc: Add -start-before/-stop-before options
MatzeB Sep 23, 2016
2a09485
[MC] Support .ds directives in assembler parser
petrhosek Sep 23, 2016
200a529
Add StringSwitch::Cases functions that takes 6 to 10 arguments.
rui314 Sep 23, 2016
e86f702
[x86] fix FCOPYSIGN lowering to create constants instead of ConstantP…
rotateright Sep 23, 2016
9194bd4
Add qualification to fix MSVC build.
pcc Sep 23, 2016
e2e5490
[libFuzzer] simplify HandleTrace again, start re-running interesting …
kcc Sep 23, 2016
c1ce9ac
GlobalStatus: Don't walk use-lists of ConstantData
dexonsmith Sep 24, 2016
ec25365
[libFuzzer] add a standalone build script
kcc Sep 24, 2016
245edb6
[RegisterBankInfo] Keep valid pointers for PartialMappings.
Sep 24, 2016
9545266
[RegisterBankInfo] Uniquely generate ValueMapping.
Sep 24, 2016
d1ab103
[RegisterBankInfo] Add statistics for dynamic value mappings.
Sep 24, 2016
ab46f81
[RegisterBankInfo] Document the design choice for the BreakDown.
Sep 24, 2016
9b47314
[RegisterBankInfo] Constify the member of the XXXMapping maps.
Sep 24, 2016
2e99ba2
[AVR] Update signature of AVRTargetObjectFile::SelectSectionForGlobal
Sep 24, 2016
e31ddb4
Analysis: Return early in isKnownNonNullAt for ConstantData
dexonsmith Sep 24, 2016
3a296bc
Scalar: Ignore ConstantData in processAssumption
dexonsmith Sep 24, 2016
c7ebf69
[x86] don't try to create a vector integer inst for an SSE1 target (P…
rotateright Sep 24, 2016
5cb2954
Analysis: Return early for UndefValue in computeKnownBits
dexonsmith Sep 24, 2016
affe799
ObjCARC: Don't look at users of ConstantData
dexonsmith Sep 24, 2016
9ca28ec
[AVX-512] Remove the patterns for selecting scalar VCOMI/VUCOMI instr…
topperc Sep 24, 2016
1e23cc8
[AVX-512] Split scalar version of X86ISD::SELECT into a separate opco…
topperc Sep 24, 2016
6928dfa
[X86] Teach combineShuffle to avoid creating floating point operation…
topperc Sep 24, 2016
386ab19
[AVX-512] Don't use two opcodes for INTR_TYPE_SCALAR_MASK_RM. The han…
topperc Sep 25, 2016
568a8f4
Add some predicated searching functions to StringRef.
Sep 25, 2016
3ae26e9
Fix signed / unsigned comparison.
Sep 25, 2016
9f072db
Add a comment on StringRef::contains(char)
Sep 25, 2016
1239ce3
[AVX-512] Remove duplicate instructions for converting integer to sca…
topperc Sep 25, 2016
a7c6d16
[AVX-512] Add the scalar unsigned integer to fp conversion instructio…
topperc Sep 25, 2016
d064828
[AVX-512] Add rounding versions of instructions to hasUndefRegUpdate.
topperc Sep 25, 2016
7913ebb
[AVX-512] Fix some patterns predicates to properly enforce priority f…
topperc Sep 25, 2016
444f89a
[AVX-512] Replace get512BitSuperRegister with calls to TargetRegister…
topperc Sep 25, 2016
277575f
[X86] Remove patterns for scalar_to_vector from FR32/FR64 to 256-bit …
topperc Sep 25, 2016
8ab193a
[X86] Remove what appears to be leftover MMX code involving (v1i64 sc…
topperc Sep 25, 2016
0d1cc51
[SCEV] Clang format most of the SCEV header; NFC
sanjoy Sep 25, 2016
3b4332c
[SCEV] Remove incidental data structure; NFC
sanjoy Sep 25, 2016
f4f66fe
[SCEV] Rename a couple of fields; NFC
sanjoy Sep 25, 2016
a2d692b
[SCEV] Simplify tracking ExitNotTakenInfo instances; NFC
sanjoy Sep 25, 2016
347d5b6
[SCEV] Have ExitNotTakenInfo keep a pointer to its predicate; NFC
sanjoy Sep 25, 2016
bfa3983
[SCEV] Document a gotcha; NFC
sanjoy Sep 25, 2016
72ec6f5
[SCEV] Reserve space in SmallVector; NFC
sanjoy Sep 25, 2016
e6b6f3a
Attempt to appease MSVC
sanjoy Sep 26, 2016
fbc0b21
Appease MSVC
sanjoy Sep 26, 2016
475c580
[SCEV] Simplify BackedgeTakenInfo::getMax; NFC
sanjoy Sep 26, 2016
643807a
[SCEV] Further isolate incidental data structure; NFC
sanjoy Sep 26, 2016
98e898c
[SCEV] Make it obvious BackedgeTakenInfo's constructor steals storage
sanjoy Sep 26, 2016
a80a7d1
[SCEV] Combine two predicates into one; NFC
sanjoy Sep 26, 2016
efbeb45
[SCEV] Assign LoopPropertiesCache in the move constructor
sanjoy Sep 26, 2016
52c8c40
[PM] Add a unittest for invalidating module analyses with an SCC pass.
chandlerc Sep 26, 2016
d6345b8
[PM] Add a unittest covering the invalidation of a Module analysis from
chandlerc Sep 26, 2016
ce297d7
[SCEV] Fix the order of members in the initializer list.
chandlerc Sep 26, 2016
de3ef8a
[X86][avx512] Fix bug in masked compress store.
aymanmusa Sep 26, 2016
56b0418
[PM] Refactor this unittest a bit to remove duplicated code. This was
chandlerc Sep 26, 2016
9209299
[X86] Optimization for replacing LEA with MOV at frame index eliminat…
Sep 26, 2016
ba54dc2
[ARM] Promote small global constants to constant pools
Sep 26, 2016
6c6dbe6
[AMDGPU] Disassembler: print label names in branch instructions
samkolton Sep 26, 2016
ecba024
Revert "[AMDGPU] Disassembler: print label names in branch instructions"
samkolton Sep 26, 2016
679be7e
[AVR] Add AVRMCExpr
Sep 26, 2016
56f90d7
[InstCombine] Teach the udiv folding logic how to handle constant exp…
adibiagio Sep 26, 2016
23d2e04
Fix typo in comment, NFC
Sep 26, 2016
3455264
[InstCombine] Fixed bug introduced in r282237
alexey-bataev Sep 26, 2016
22c9f71
Merge branch 'amd-master' into amd-common
kzhuravl Sep 26, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions include/llvm/ADT/StringRef.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#ifndef LLVM_ADT_STRINGREF_H
#define LLVM_ADT_STRINGREF_H

#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/Compiler.h"
#include <algorithm>
Expand Down Expand Up @@ -276,6 +277,32 @@ namespace llvm {
return npos;
}

/// Search for the first character satisfying the predicate \p F
///
/// \returns The index of the first character satisfying \p F starting from
/// \p From, or npos if not found.
LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_UNUSED_RESULT
size_t find_if(function_ref<bool(char)> F, size_t From = 0) const {
StringRef S = drop_front(From);
while (!S.empty()) {
if (F(S.front()))
return size() - S.size();
S = S.drop_front();
}
return npos;
}

/// Search for the first character not satisfying the predicate \p F
///
/// \returns The index of the first character not satisfying \p F starting
/// from \p From, or npos if not found.
LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_UNUSED_RESULT
size_t find_if_not(function_ref<bool(char)> F, size_t From = 0) const {
return find_if([F](char c) { return !F(c); }, From);
}

/// Search for the first string \p Str in the string.
///
/// \returns The index of the first occurrence of \p Str, or npos if not
Expand Down Expand Up @@ -352,6 +379,11 @@ namespace llvm {
LLVM_ATTRIBUTE_ALWAYS_INLINE
bool contains(StringRef Other) const { return find(Other) != npos; }

/// Return true if the given character is contained in *this, and false
/// otherwise.
LLVM_ATTRIBUTE_ALWAYS_INLINE
bool contains(char C) const { return find_first_of(C) != npos; }

/// @}
/// @name Helpful Algorithms
/// @{
Expand Down Expand Up @@ -496,6 +528,22 @@ namespace llvm {
return drop_front(size() - N);
}

/// Return the longest prefix of 'this' such that every character
/// in the prefix satisfies the given predicate.
LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_UNUSED_RESULT
StringRef take_while(function_ref<bool(char)> F) const {
return substr(0, find_if_not(F));
}

/// Return the longest prefix of 'this' such that no character in
/// the prefix satisfies the given predicate.
LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_UNUSED_RESULT
StringRef take_until(function_ref<bool(char)> F) const {
return substr(0, find_if(F));
}

/// Return a StringRef equal to 'this' but with the first \p N elements
/// dropped.
LLVM_ATTRIBUTE_ALWAYS_INLINE
Expand All @@ -514,6 +562,22 @@ namespace llvm {
return substr(0, size()-N);
}

/// Return a StringRef equal to 'this', but with all characters satisfying
/// the given predicate dropped from the beginning of the string.
LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_UNUSED_RESULT
StringRef drop_while(function_ref<bool(char)> F) const {
return substr(find_if_not(F));
}

/// Return a StringRef equal to 'this', but with all characters not
/// satisfying the given predicate dropped from the beginning of the string.
LLVM_ATTRIBUTE_ALWAYS_INLINE
LLVM_ATTRIBUTE_UNUSED_RESULT
StringRef drop_until(function_ref<bool(char)> F) const {
return substr(find_if(F));
}

/// Returns true if this StringRef has the given prefix and removes that
/// prefix.
LLVM_ATTRIBUTE_ALWAYS_INLINE
Expand Down
102 changes: 61 additions & 41 deletions include/llvm/ADT/StringSwitch.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ class StringSwitch {
(std::memcmp(S, Str.data(), N-1) == 0)) {
Result = &Value;
}

return *this;
}

Expand All @@ -86,7 +85,6 @@ class StringSwitch {
std::memcmp(S, Str.data() + Str.size() + 1 - N, N-1) == 0) {
Result = &Value;
}

return *this;
}

Expand All @@ -97,75 +95,97 @@ class StringSwitch {
std::memcmp(S, Str.data(), N-1) == 0) {
Result = &Value;
}

return *this;
}

template<unsigned N0, unsigned N1>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1],
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const T& Value) {
if (!Result && (
(N0-1 == Str.size() && std::memcmp(S0, Str.data(), N0-1) == 0) ||
(N1-1 == Str.size() && std::memcmp(S1, Str.data(), N1-1) == 0))) {
Result = &Value;
}

return *this;
return Case(S0, Value).Case(S1, Value);
}

template<unsigned N0, unsigned N1, unsigned N2>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1],
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const T& Value) {
if (!Result && (
(N0-1 == Str.size() && std::memcmp(S0, Str.data(), N0-1) == 0) ||
(N1-1 == Str.size() && std::memcmp(S1, Str.data(), N1-1) == 0) ||
(N2-1 == Str.size() && std::memcmp(S2, Str.data(), N2-1) == 0))) {
Result = &Value;
}

return *this;
return Case(S0, Value).Cases(S1, S2, Value);
}

template<unsigned N0, unsigned N1, unsigned N2, unsigned N3>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1],
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const char (&S3)[N3],
const T& Value) {
if (!Result && (
(N0-1 == Str.size() && std::memcmp(S0, Str.data(), N0-1) == 0) ||
(N1-1 == Str.size() && std::memcmp(S1, Str.data(), N1-1) == 0) ||
(N2-1 == Str.size() && std::memcmp(S2, Str.data(), N2-1) == 0) ||
(N3-1 == Str.size() && std::memcmp(S3, Str.data(), N3-1) == 0))) {
Result = &Value;
}

return *this;
return Case(S0, Value).Cases(S1, S2, S3, Value);
}

template<unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1],
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const char (&S3)[N3],
const char (&S4)[N4], const T& Value) {
if (!Result && (
(N0-1 == Str.size() && std::memcmp(S0, Str.data(), N0-1) == 0) ||
(N1-1 == Str.size() && std::memcmp(S1, Str.data(), N1-1) == 0) ||
(N2-1 == Str.size() && std::memcmp(S2, Str.data(), N2-1) == 0) ||
(N3-1 == Str.size() && std::memcmp(S3, Str.data(), N3-1) == 0) ||
(N4-1 == Str.size() && std::memcmp(S4, Str.data(), N4-1) == 0))) {
Result = &Value;
}
return Case(S0, Value).Cases(S1, S2, S3, S4, Value);
}

return *this;
template <unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4,
unsigned N5>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const char (&S3)[N3],
const char (&S4)[N4], const char (&S5)[N5],
const T &Value) {
return Case(S0, Value).Cases(S1, S2, S3, S4, S5, Value);
}

template <unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4,
unsigned N5, unsigned N6>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const char (&S3)[N3],
const char (&S4)[N4], const char (&S5)[N5],
const char (&S6)[N6], const T &Value) {
return Case(S0, Value).Cases(S1, S2, S3, S4, S5, S6, Value);
}

template <unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4,
unsigned N5, unsigned N6, unsigned N7>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const char (&S3)[N3],
const char (&S4)[N4], const char (&S5)[N5],
const char (&S6)[N6], const char (&S7)[N7],
const T &Value) {
return Case(S0, Value).Cases(S1, S2, S3, S4, S5, S6, S7, Value);
}

template <unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4,
unsigned N5, unsigned N6, unsigned N7, unsigned N8>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const char (&S3)[N3],
const char (&S4)[N4], const char (&S5)[N5],
const char (&S6)[N6], const char (&S7)[N7],
const char (&S8)[N8], const T &Value) {
return Case(S0, Value).Cases(S1, S2, S3, S4, S5, S6, S7, S8, Value);
}

template <unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4,
unsigned N5, unsigned N6, unsigned N7, unsigned N8, unsigned N9>
LLVM_ATTRIBUTE_ALWAYS_INLINE
StringSwitch &Cases(const char (&S0)[N0], const char (&S1)[N1],
const char (&S2)[N2], const char (&S3)[N3],
const char (&S4)[N4], const char (&S5)[N5],
const char (&S6)[N6], const char (&S7)[N7],
const char (&S8)[N8], const char (&S9)[N9],
const T &Value) {
return Case(S0, Value).Cases(S1, S2, S3, S4, S5, S6, S7, S8, S9, Value);
}

LLVM_ATTRIBUTE_ALWAYS_INLINE
R Default(const T& Value) const {
if (Result)
return *Result;

return Value;
}

Expand Down
Loading