-
Notifications
You must be signed in to change notification settings - Fork 31
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
Function to estimate stack size (using existing tooling) #1121
Conversation
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.
LGTM, just some nits and question
compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp
Outdated
Show resolved
Hide resolved
compiler/plugins/target/AMD-AIE/iree-amd-aie/Target/XCLBinGen.cpp
Outdated
Show resolved
Hide resolved
llvm::errs() << "Failed to get upper bounds of stack sizes\n"; | ||
return failure(); | ||
} | ||
auto upperBounds = std::move(maybeUpperBounds.value()); |
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.
auto upperBounds = std::move(maybeUpperBounds.value()); | |
llvm::DenseMap<std::pair<uint32_t, uint32_t>, uint32_t> upperBounds = std::move(maybeUpperBounds.value()); |
llvm::errs() << "Failed to assemble ll with peano\n"; | ||
return failure(); | ||
} | ||
|
||
// If this is not windows, we can do this check. On windows checkTool | ||
// doesn't pipe outputs correctly. |
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.
outputs
being the stack sizes right?
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.
Yeah, in runTool the piping is gated on WIN32. Specifically I think it's this redirection for windows redirects = {{}, {}, {}}
which means we don't get the logging back (and I don't want to sink hours into fixing this now!)
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.
(I've reworded)
mlir::FailureOr<llvm::DenseMap<std::pair<uint32_t, uint32_t>, uint32_t>> | ||
ubs = detail::getUpperBoundStackSizes(asmStr); | ||
EXPECT_TRUE(succeeded(ubs)); | ||
// auto upperBounds = maybeUpperBounds.value(); |
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.
// auto upperBounds = maybeUpperBounds.value(); |
b9c76d9
to
cbfb00d
Compare
cbfb00d
to
bb56565
Compare
This will replace #1116 -- instead of string matching the assembly file, it uses llvm's
llvm-readelf
after adding--stack-size-section
to the llc call.