Skip to content

Commit

Permalink
merge main into amd-staging
Browse files Browse the repository at this point in the history
Reverts: depends upon earlier ctx_prof reverts
c99bd3c [ctx_prof] Extend `WorkloadImportsManager` to use the contextual profile (llvm#98682)

Change-Id: I602defa5d5aa32c272ba831165cb39cf8f83b5ba
  • Loading branch information
animeshk-amd committed Jul 30, 2024
2 parents 23bbdfe + f9765a2 commit 4d9ec6f
Show file tree
Hide file tree
Showing 26 changed files with 956 additions and 182 deletions.
2 changes: 1 addition & 1 deletion compiler-rt/lib/memprof/memprof_mapping.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ extern uptr kHighMemEnd; // Initialized in __memprof_init.
// computed by summing up all individual 1 byte counters. This can incur an
// accuracy penalty.

#define HISTOGRAM_GRANULARITY 8U
#define HISTOGRAM_GRANULARITY 8ULL

#define HISTOGRAM_MAX_COUNTER 255U

Expand Down
10 changes: 0 additions & 10 deletions compiler-rt/lib/nsan/nsan_interceptors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

#include <wchar.h>

#if SANITIZER_LINUX
extern "C" int mallopt(int param, int value);
#endif

using namespace __sanitizer;
using __nsan::nsan_init_is_running;
using __nsan::nsan_initialized;
Expand Down Expand Up @@ -209,12 +205,6 @@ void __nsan::InitializeInterceptors() {
static bool initialized = false;
CHECK(!initialized);

// Instruct libc malloc to consume less memory.
#if SANITIZER_LINUX
mallopt(1, 0); // M_MXFAST
mallopt(-3, 32 * 1024); // M_MMAP_THRESHOLD
#endif

InitializeMallocInterceptors();

INTERCEPT_FUNCTION(memset);
Expand Down
32 changes: 16 additions & 16 deletions compiler-rt/lib/sanitizer_common/sanitizer_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2386,25 +2386,25 @@ void SignalContext::DumpAllRegisters(void *context) {
# elif SANITIZER_FREEBSD
# if defined(__x86_64__)
Report("Register values:\n");
Printf("rax = 0x%016llx ", ucontext->uc_mcontext.mc_rax);
Printf("rbx = 0x%016llx ", ucontext->uc_mcontext.mc_rbx);
Printf("rcx = 0x%016llx ", ucontext->uc_mcontext.mc_rcx);
Printf("rdx = 0x%016llx ", ucontext->uc_mcontext.mc_rdx);
Printf("rax = 0x%016lx ", ucontext->uc_mcontext.mc_rax);
Printf("rbx = 0x%016lx ", ucontext->uc_mcontext.mc_rbx);
Printf("rcx = 0x%016lx ", ucontext->uc_mcontext.mc_rcx);
Printf("rdx = 0x%016lx ", ucontext->uc_mcontext.mc_rdx);
Printf("\n");
Printf("rdi = 0x%016llx ", ucontext->uc_mcontext.mc_rdi);
Printf("rsi = 0x%016llx ", ucontext->uc_mcontext.mc_rsi);
Printf("rbp = 0x%016llx ", ucontext->uc_mcontext.mc_rbp);
Printf("rsp = 0x%016llx ", ucontext->uc_mcontext.mc_rsp);
Printf("rdi = 0x%016lx ", ucontext->uc_mcontext.mc_rdi);
Printf("rsi = 0x%016lx ", ucontext->uc_mcontext.mc_rsi);
Printf("rbp = 0x%016lx ", ucontext->uc_mcontext.mc_rbp);
Printf("rsp = 0x%016lx ", ucontext->uc_mcontext.mc_rsp);
Printf("\n");
Printf(" r8 = 0x%016llx ", ucontext->uc_mcontext.mc_r8);
Printf(" r9 = 0x%016llx ", ucontext->uc_mcontext.mc_r9);
Printf("r10 = 0x%016llx ", ucontext->uc_mcontext.mc_r10);
Printf("r11 = 0x%016llx ", ucontext->uc_mcontext.mc_r11);
Printf(" r8 = 0x%016lx ", ucontext->uc_mcontext.mc_r8);
Printf(" r9 = 0x%016lx ", ucontext->uc_mcontext.mc_r9);
Printf("r10 = 0x%016lx ", ucontext->uc_mcontext.mc_r10);
Printf("r11 = 0x%016lx ", ucontext->uc_mcontext.mc_r11);
Printf("\n");
Printf("r12 = 0x%016llx ", ucontext->uc_mcontext.mc_r12);
Printf("r13 = 0x%016llx ", ucontext->uc_mcontext.mc_r13);
Printf("r14 = 0x%016llx ", ucontext->uc_mcontext.mc_r14);
Printf("r15 = 0x%016llx ", ucontext->uc_mcontext.mc_r15);
Printf("r12 = 0x%016lx ", ucontext->uc_mcontext.mc_r12);
Printf("r13 = 0x%016lx ", ucontext->uc_mcontext.mc_r13);
Printf("r14 = 0x%016lx ", ucontext->uc_mcontext.mc_r14);
Printf("r15 = 0x%016lx ", ucontext->uc_mcontext.mc_r15);
Printf("\n");
# elif defined(__i386__)
Report("Register values:\n");
Expand Down
57 changes: 43 additions & 14 deletions llvm/include/llvm/Analysis/DXILResource.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,11 @@ class ResourceInfo {

MSInfo MultiSample;

public:
ResourceInfo(dxil::ResourceClass RC, dxil::ResourceKind Kind, Value *Symbol,
StringRef Name)
: Symbol(Symbol), Name(Name), RC(RC), Kind(Kind) {}

// Conditions to check before accessing union members.
bool isUAV() const;
bool isCBuffer() const;
Expand All @@ -115,11 +120,45 @@ class ResourceInfo {
bool isFeedback() const;
bool isMultiSample() const;

ResourceInfo(dxil::ResourceClass RC, dxil::ResourceKind Kind, Value *Symbol,
StringRef Name)
: Symbol(Symbol), Name(Name), RC(RC), Kind(Kind) {}
void bind(uint32_t UniqueID, uint32_t Space, uint32_t LowerBound,
uint32_t Size) {
Binding.UniqueID = UniqueID;
Binding.Space = Space;
Binding.LowerBound = LowerBound;
Binding.Size = Size;
}
void setUAV(bool GloballyCoherent, bool HasCounter, bool IsROV) {
assert(isUAV() && "Not a UAV");
UAVFlags.GloballyCoherent = GloballyCoherent;
UAVFlags.HasCounter = HasCounter;
UAVFlags.IsROV = IsROV;
}
void setCBuffer(uint32_t Size) {
assert(isCBuffer() && "Not a CBuffer");
CBufferSize = Size;
}
void setSampler(dxil::SamplerType Ty) { SamplerTy = Ty; }
void setStruct(uint32_t Stride, Align Alignment) {
assert(isStruct() && "Not a Struct");
Struct.Stride = Stride;
Struct.Alignment = Alignment;
}
void setTyped(dxil::ElementType ElementTy, uint32_t ElementCount) {
assert(isTyped() && "Not Typed");
Typed.ElementTy = ElementTy;
Typed.ElementCount = ElementCount;
}
void setFeedback(dxil::SamplerFeedbackType Type) {
assert(isFeedback() && "Not Feedback");
Feedback.Type = Type;
}
void setMultiSample(uint32_t Count) {
assert(isMultiSample() && "Not MultiSampled");
MultiSample.Count = Count;
}

bool operator==(const ResourceInfo &RHS) const;

public:
static ResourceInfo SRV(Value *Symbol, StringRef Name,
dxil::ElementType ElementTy, uint32_t ElementCount,
dxil::ResourceKind Kind);
Expand Down Expand Up @@ -164,16 +203,6 @@ class ResourceInfo {
static ResourceInfo Sampler(Value *Symbol, StringRef Name,
dxil::SamplerType SamplerTy);

void bind(uint32_t UniqueID, uint32_t Space, uint32_t LowerBound,
uint32_t Size) {
Binding.UniqueID = UniqueID;
Binding.Space = Space;
Binding.LowerBound = LowerBound;
Binding.Size = Size;
}

bool operator==(const ResourceInfo &RHS) const;

MDTuple *getAsMetadata(LLVMContext &Ctx) const;

ResourceBinding getBinding() const { return Binding; }
Expand Down
13 changes: 7 additions & 6 deletions llvm/include/llvm/MC/MCFragment.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,15 @@ class MCFragment {
FragmentType Kind;

protected:
/// Used by subclasses for better packing.
///
/// MCEncodedFragment
bool HasInstructions : 1;
bool AlignToBundleEnd : 1;
/// MCDataFragment
bool LinkerRelaxable : 1;
/// MCRelaxableFragment: x86-specific
bool AllowAutoPadding : 1;

MCFragment(FragmentType Kind, bool HasInstructions);

Expand Down Expand Up @@ -115,9 +122,6 @@ class MCDummyFragment : public MCFragment {
/// data.
///
class MCEncodedFragment : public MCFragment {
/// Should this fragment be aligned to the end of a bundle?
bool AlignToBundleEnd = false;

uint8_t BundlePadding = 0;

protected:
Expand Down Expand Up @@ -228,11 +232,8 @@ class MCDataFragment : public MCEncodedFragmentWithFixups<32, 4> {
/// relaxed during the assembler layout and relaxation stage.
///
class MCRelaxableFragment : public MCEncodedFragmentWithFixups<8, 1> {

/// The instruction this is a fragment for.
MCInst Inst;
/// Can we auto pad the instruction?
bool AllowAutoPadding = false;

public:
MCRelaxableFragment(const MCInst &Inst, const MCSubtargetInfo &STI)
Expand Down
4 changes: 4 additions & 0 deletions llvm/include/llvm/Passes/PassBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -944,6 +944,10 @@ class NoOpLoopAnalysis : public AnalysisInfoMixin<NoOpLoopAnalysis> {
return Result();
}
};

/// Common option used by multiple tools to print pipeline passes
extern cl::opt<bool> PrintPipelinePasses;

}

#endif
Loading

0 comments on commit 4d9ec6f

Please sign in to comment.