[llvm] [RISCV][MC] Implement evaluateBranch for auipc+jalr pairs (PR #65480)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 3 07:09:38 PDT 2023


arichardson wrote:

> > That seems better than expected and might be acceptable. However, I think using a bitset that can be zeroed with a single store should bring it down to near zero and will not add much complexity.
> 
> I implemented this and to my surprise, the overhead is still around 1%. After some digging, I noticed that the increase in runtime seems almost entirely due to the increased output size (total size increase is about 2% on the clang benchmark, the functions contributing the most to the increased runtime are output-related ones like `llvm::sys::unicode::columnWidthUTF8`).
> 
> Since this overhead is unavoidable, do you still feel it's worthwhile to implement the optimization?

I guess it makes sense that printing and looking up symbols is more expensive than zeroing 512 bytes somewhat regularly. I think the optimization does make sense unless it makes the code a lot less readable. But I'll leave that decision to other reviewers. The change looks good to me now but please wait for a review from someone else before merging.

https://github.com/llvm/llvm-project/pull/65480


More information about the llvm-commits mailing list