-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[flang] Disable noalias by default #142128
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,6 +10,14 @@ | |
| /// common to flang and the test tools. | ||
|
|
||
| #include "flang/Optimizer/Passes/Pipelines.h" | ||
| #include "llvm/Support/CommandLine.h" | ||
|
|
||
| /// Force setting the no-alias attribute on fuction arguments when possible. | ||
| static llvm::cl::opt<bool> forceNoAlias("force-no-alias", llvm::cl::Hidden, | ||
| llvm::cl::init(false)); | ||
| /// Force setting the no-capture attribute on fuction arguments when possible. | ||
| static llvm::cl::opt<bool> forceNoCapture("force-no-capture", llvm::cl::Hidden, | ||
| llvm::cl::init(false)); | ||
|
|
||
| namespace fir { | ||
|
|
||
|
|
@@ -350,9 +358,10 @@ void createDefaultFIRCodeGenPassPipeline(mlir::PassManager &pm, | |
| else | ||
| framePointerKind = mlir::LLVM::framePointerKind::FramePointerKind::None; | ||
|
|
||
| bool setNoCapture = false, setNoAlias = false; | ||
| if (config.OptLevel.isOptimizingForSpeed()) | ||
| setNoCapture = setNoAlias = true; | ||
| // TODO: re-enable setNoAlias by default (when optimizing for speed) once | ||
| // function specialization is fixed. | ||
| bool setNoAlias = forceNoAlias; | ||
| bool setNoCapture = forceNoCapture; | ||
|
||
|
|
||
| pm.addPass(fir::createFunctionAttr( | ||
| {framePointerKind, config.InstrumentFunctionEntry, | ||
|
|
||
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.
Tom, will you be okay if I just remove this
if? The LIT tests should still work, and it will be easier to re-enable the code, when function speciailization is fixed.