Skip to content

Commit 179d21c

Browse files
committed
Merge branch 'amd-master' into amd-common
Change-Id: I561a0faa6fb8e8c152e6d4c86cbdd3991ac5ede2
2 parents dcadb4c + 3aa3118 commit 179d21c

File tree

146 files changed

+5657
-1766
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

146 files changed

+5657
-1766
lines changed

cmake/modules/CheckCompilerVersion.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ if(NOT DEFINED LLVM_COMPILER_CHECKED)
88

99
if(NOT LLVM_FORCE_USE_OLD_TOOLCHAIN)
1010
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
11-
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8)
12-
message(FATAL_ERROR "Host GCC version must be at least 4.8!")
11+
# FIXME: Change this to 4.8 once documentation builder bot is upgraded
12+
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.7)
13+
message(FATAL_ERROR "Host GCC version must be at least 4.7!")
1314
endif()
1415
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
1516
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 3.1)
@@ -35,7 +36,8 @@ std::atomic<float> x(0.0f);
3536
int main() { return (float)x; }"
3637
LLVM_NO_OLD_LIBSTDCXX)
3738
if(NOT LLVM_NO_OLD_LIBSTDCXX)
38-
message(FATAL_ERROR "Host Clang must be able to find libstdc++4.8 or newer!")
39+
# FIXME: Change this to 4.8 once documentation builder bot is upgraded
40+
message(FATAL_ERROR "Host Clang must be able to find libstdc++4.7 or newer!")
3941
endif()
4042
set(CMAKE_REQUIRED_FLAGS ${OLD_CMAKE_REQUIRED_FLAGS})
4143
set(CMAKE_REQUIRED_LIBRARIES ${OLD_CMAKE_REQUIRED_LIBRARIES})

cmake/modules/HandleLLVMOptions.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,11 @@ string(TOUPPER "${LLVM_ENABLE_LTO}" uppercase_LLVM_ENABLE_LTO)
647647
if(uppercase_LLVM_ENABLE_LTO STREQUAL "THIN")
648648
append("-flto=thin" CMAKE_CXX_FLAGS CMAKE_C_FLAGS
649649
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
650+
# On darwin, enable the lto cache. This improves initial build time a little
651+
# since we re-link a lot of the same objects, and significantly improves
652+
# incremental build time.
653+
append_if(APPLE "-Wl,-cache_path_lto,${PROJECT_BINARY_DIR}/lto.cache"
654+
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)
650655
elseif(uppercase_LLVM_ENABLE_LTO STREQUAL "FULL")
651656
append("-flto=full" CMAKE_CXX_FLAGS CMAKE_C_FLAGS
652657
CMAKE_EXE_LINKER_FLAGS CMAKE_SHARED_LINKER_FLAGS)

docs/LibFuzzer.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ Some important things to remember about fuzz targets:
8080
* The fuzzing engine will execute the fuzz target many times with different inputs in the same process.
8181
* It must tolerate any kind of input (empty, huge, malformed, etc).
8282
* It must not `exit()` on any input.
83-
* It may use multiple threads but ideally all threads should be joined at the end of the function.
83+
* It may use threads but ideally all threads should be joined at the end of the function.
84+
* It must be as deterministic as possible. Non-determinism (e.g. random decisions not based on the input byte) will make fuzzing inefficient.
85+
* It must be fast. Try avoiding cubic or greater complexity.
8486
* Ideally, it should not modify any global state (although that's not strict).
8587

8688

@@ -759,6 +761,8 @@ Trophies
759761

760762
* Tensorflow: `[1] <https://github.com/tensorflow/tensorflow/commit/7231d01fcb2cd9ef9ffbfea03b724892c8a4026e>`__
761763

764+
* Ffmpeg: `[1] <https://github.com/FFmpeg/FFmpeg/commit/c92f55847a3d9cd12db60bfcd0831ff7f089c37c>`__ `[2] <https://github.com/FFmpeg/FFmpeg/commit/25ab1a65f3acb5ec67b53fb7a2463a7368f1ad16>`__ `[3] <https://github.com/FFmpeg/FFmpeg/commit/85d23e5cbc9ad6835eef870a5b4247de78febe56>`__
765+
762766
.. _pcre2: http://www.pcre.org/
763767
.. _AFL: http://lcamtuf.coredump.cx/afl/
764768
.. _Radamsa: https://github.com/aoh/radamsa

include/llvm/ADT/APFloat.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ class APFloat : public APFloatBase {
712712
Double = std::move(RHS.Double);
713713
} else if (this != &RHS) {
714714
this->~Storage();
715-
new (this) Storage(RHS);
715+
new (this) Storage(std::move(RHS));
716716
}
717717
return *this;
718718
}
@@ -777,6 +777,7 @@ class APFloat : public APFloatBase {
777777
APFloat(const fltSemantics &Semantics) : U(Semantics) {}
778778
APFloat(const fltSemantics &Semantics, StringRef S);
779779
APFloat(const fltSemantics &Semantics, integerPart I) : U(Semantics, I) {}
780+
// TODO: Remove this constructor. This isn't faster than the first one.
780781
APFloat(const fltSemantics &Semantics, uninitializedTag)
781782
: U(Semantics, uninitialized) {}
782783
APFloat(const fltSemantics &Semantics, const APInt &I) : U(Semantics, I) {}

include/llvm/Analysis/ModuleSummaryAnalysis.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,6 @@ class ModuleSummaryIndexWrapperPass : public ModulePass {
7070
// object for the module, to be written to bitcode or LLVM assembly.
7171
//
7272
ModulePass *createModuleSummaryIndexWrapperPass();
73-
74-
/// Returns true if \p M is eligible for ThinLTO promotion.
75-
///
76-
/// Currently we check if it has any any InlineASM that uses an internal symbol.
77-
bool moduleCanBeRenamedForThinLTO(const Module &M);
7873
}
7974

8075
#endif

include/llvm/CodeGen/MachineRegisterInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,7 +553,7 @@ class MachineRegisterInfo {
553553
/// isConstantPhysReg - Returns true if PhysReg is unallocatable and constant
554554
/// throughout the function. It is safe to move instructions that read such
555555
/// a physreg.
556-
bool isConstantPhysReg(unsigned PhysReg, const MachineFunction &MF) const;
556+
bool isConstantPhysReg(unsigned PhysReg) const;
557557

558558
/// Get an iterator over the pressure sets affected by the given physical or
559559
/// virtual register. If RegUnit is physical, it must be a register unit (from

include/llvm/CodeGen/SelectionDAG.h

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,12 +1256,22 @@ class SelectionDAG {
12561256
const;
12571257

12581258
/// Determine which bits of Op are known to be either zero or one and return
1259-
/// them in the KnownZero/KnownOne bitsets. Targets can implement the
1260-
/// computeKnownBitsForTargetNode method in the TargetLowering class to allow
1261-
/// target nodes to be understood.
1259+
/// them in the KnownZero/KnownOne bitsets. For vectors, the known bits are
1260+
/// those that are shared by every vector element.
1261+
/// Targets can implement the computeKnownBitsForTargetNode method in the
1262+
/// TargetLowering class to allow target nodes to be understood.
12621263
void computeKnownBits(SDValue Op, APInt &KnownZero, APInt &KnownOne,
12631264
unsigned Depth = 0) const;
12641265

1266+
/// Determine which bits of Op are known to be either zero or one and return
1267+
/// them in the KnownZero/KnownOne bitsets. The DemandedElts argument allows
1268+
/// us to only collect the known bits that are shared by the requested vector
1269+
/// elements.
1270+
/// Targets can implement the computeKnownBitsForTargetNode method in the
1271+
/// TargetLowering class to allow target nodes to be understood.
1272+
void computeKnownBits(SDValue Op, APInt &KnownZero, APInt &KnownOne,
1273+
const APInt &DemandedElts, unsigned Depth = 0) const;
1274+
12651275
/// Test if the given value is known to have exactly one bit set. This differs
12661276
/// from computeKnownBits in that it doesn't necessarily determine which bit
12671277
/// is set.

include/llvm/DebugInfo/PDB/Raw/DbiStreamBuilder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ class DbiStreamBuilder {
7070
uint32_t calculateModiSubstreamSize() const;
7171
uint32_t calculateFileInfoSubstreamSize() const;
7272
uint32_t calculateNamesBufferSize() const;
73+
uint32_t calculateDbgStreamsSize() const;
7374

7475
Error generateModiSubstream();
7576
Error generateFileInfoSubstream();

include/llvm/IR/IntrinsicsPowerPC.td

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,17 @@ let TargetPrefix = "ppc" in { // All intrinsics start with "llvm.ppc.".
360360
def int_ppc_altivec_vcmpnezb_p : GCCBuiltin<"__builtin_altivec_vcmpnezb_p">,
361361
Intrinsic<[llvm_i32_ty],[llvm_i32_ty,llvm_v16i8_ty,llvm_v16i8_ty],
362362
[IntrNoMem]>;
363+
def int_ppc_altivec_vclzlsbb : GCCBuiltin<"__builtin_altivec_vclzlsbb">,
364+
Intrinsic<[llvm_i32_ty],[llvm_v16i8_ty],[IntrNoMem]>;
365+
def int_ppc_altivec_vctzlsbb : GCCBuiltin<"__builtin_altivec_vctzlsbb">,
366+
Intrinsic<[llvm_i32_ty],[llvm_v16i8_ty],[IntrNoMem]>;
367+
def int_ppc_altivec_vprtybw : GCCBuiltin<"__builtin_altivec_vprtybw">,
368+
Intrinsic<[llvm_v4i32_ty],[llvm_v4i32_ty],[IntrNoMem]>;
369+
def int_ppc_altivec_vprtybd : GCCBuiltin<"__builtin_altivec_vprtybd">,
370+
Intrinsic<[llvm_v2i64_ty],[llvm_v2i64_ty],[IntrNoMem]>;
371+
def int_ppc_altivec_vprtybq : GCCBuiltin<"__builtin_altivec_vprtybq">,
372+
Intrinsic<[llvm_v1i128_ty],[llvm_v1i128_ty],[IntrNoMem]>;
373+
363374
}
364375

365376
// Vector average.

include/llvm/IR/ModuleSummaryIndex.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ class GlobalValueSummary {
194194
/// possibly referenced from inline assembly, etc).
195195
bool noRename() const { return Flags.NoRename; }
196196

197+
/// Flag that this global value cannot be renamed (in a specific section,
198+
/// possibly referenced from inline assembly, etc).
199+
void setNoRename() { Flags.NoRename = true; }
200+
197201
/// Record a reference from this global value to the global value identified
198202
/// by \p RefGUID.
199203
void addRefEdge(GlobalValue::GUID RefGUID) { RefEdgeList.push_back(RefGUID); }

include/llvm/Object/ELFObjectFile.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class ELFObjectFileBase : public ObjectFile {
5959

6060
virtual uint32_t getSectionType(DataRefImpl Sec) const = 0;
6161
virtual uint64_t getSectionFlags(DataRefImpl Sec) const = 0;
62+
virtual uint64_t getSectionOffset(DataRefImpl Sec) const = 0;
6263

6364
virtual ErrorOr<int64_t> getRelocationAddend(DataRefImpl Rel) const = 0;
6465

@@ -90,6 +91,10 @@ class ELFSectionRef : public SectionRef {
9091
uint64_t getFlags() const {
9192
return getObject()->getSectionFlags(getRawDataRefImpl());
9293
}
94+
95+
uint64_t getOffset() const {
96+
return getObject()->getSectionOffset(getRawDataRefImpl());
97+
}
9398
};
9499

95100
class elf_section_iterator : public section_iterator {
@@ -245,6 +250,7 @@ template <class ELFT> class ELFObjectFile : public ELFObjectFileBase {
245250

246251
uint32_t getSectionType(DataRefImpl Sec) const override;
247252
uint64_t getSectionFlags(DataRefImpl Sec) const override;
253+
uint64_t getSectionOffset(DataRefImpl Sec) const override;
248254
StringRef getRelocationTypeName(uint32_t Type) const;
249255

250256
/// \brief Get the relocation section that contains \a Rel.
@@ -380,6 +386,11 @@ uint32_t ELFObjectFile<ELFT>::getSectionType(DataRefImpl Sec) const {
380386
return getSection(Sec)->sh_type;
381387
}
382388

389+
template <class ELFT>
390+
uint64_t ELFObjectFile<ELFT>::getSectionOffset(DataRefImpl Sec) const {
391+
return getSection(Sec)->sh_offset;
392+
}
393+
383394
template <class ELFT>
384395
uint64_t ELFObjectFile<ELFT>::getSymbolValueImpl(DataRefImpl Symb) const {
385396
const Elf_Sym *ESym = getSymbol(Symb);

0 commit comments

Comments
 (0)