-
Notifications
You must be signed in to change notification settings - Fork 686
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
Add support for custom allocators #390
Conversation
❌ Build DirectXShaderCompiler 1.0.388 failed (commit 0701c580f4 by @marcelolr) |
lib/Analysis/ScalarEvolution.cpp
Outdated
cl::desc("Maximum number of iterations SCEV will " | ||
"symbolically execute a constant " | ||
"derived loop"), | ||
cl::init(100)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintended indentation changes?
lib/Analysis/TargetLibraryInfo.cpp
Outdated
"No vector functions library"), | ||
clEnumValN(TargetLibraryInfoImpl::Accelerate, "Accelerate", | ||
"Accelerate framework"), | ||
clEnumValEnd)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More indent changes.
lib/Analysis/ValueTracking.cpp
Outdated
/// Enable an experimental feature to leverage information about dominating | ||
/// conditions to compute known bits. The individual options below control how | ||
/// hard we search. The defaults are choosen to be fairly aggressive. If you | ||
/// run into compile time problems when testing, scale them back and report | ||
/// your findings. | ||
static cl::opt<bool> EnableDomConditions("value-tracking-dom-conditions", | ||
cl::Hidden, cl::init(false)); | ||
cl::Hidden, cl::init(false)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More indent changes and below..
lib/Analysis/regioninfo.cpp
Outdated
clEnumValN(Region::PrintRN, "rn", | ||
"print regions in detail with element_iterator"), | ||
"print regions in detail with element_iterator"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indent changes...
lib/Analysis/DependenceAnalysis.cpp
Outdated
static cl::opt<bool> | ||
Delinearize("da-delinearize", cl::init(false), cl::Hidden, cl::ZeroOrMore, | ||
cl::desc("Try to delinearize array references.")); | ||
cl::desc("Try to delinearize array references.")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unintended indent change?
unsigned Column) { | ||
const std::string &Filename, | ||
unsigned Line, | ||
unsigned Column) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More indent changes
llvm::outs())); | ||
Loc.FileName, Loc.Line, Loc.Column, | ||
getFrontendOpts().CodeCompleteOpts, | ||
llvm::outs())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent
Loc.Line, Loc.Column)) { | ||
} | ||
else if (EnableCodeCompletion(getPreprocessor(), Loc.FileName, | ||
Loc.Line, Loc.Column)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting/indent
unsigned Line, | ||
unsigned Column, | ||
const CodeCompleteOptions &Opts, | ||
raw_ostream &OS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indent-only changes here and above/below
@@ -147,7 +148,13 @@ bool VersionSupportInfo::SkipDxil_1_1_Test() { | |||
} | |||
return false; | |||
} | |||
|
|||
bool VersionSupportInfo::SkipOutOfMemoryTest() { | |||
if (m_CompilerPreservesBBNames) { // same detection logic at the moment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably just rename this member to m_CompilerIsDebugBuild or something, since that's what it really tracks.
❌ Build DirectXShaderCompiler 1.0.414 failed (commit 6662367b52 by @marcelolr) |
❌ Build DirectXShaderCompiler 1.0.415 failed (commit 035d1edc09 by @marcelolr) |
This is a big change that cleans up various aspects of memory management and adds support for memory allocators to be passed into the library.
There is a new entry point into dxcompiler, DxcCreateInstance2, which allows for the caller to provide an IMalloc implementation that will be used for all memory operations involving calls into that object. In support of this, the following changes are made.
There is likely more work to be done on cleaning up in exception paths properly in the presence of bad_alloc exceptions, but this is a step in the right direction.
This capability allows the compiler and its component libraries to be used in scenarios where memory allocation policy is directed by the application, for example by limiting the maximum available memory, allocating with some particular book-keeping strategy, or using a specific area of memory.