[PATCH] D66987: [InlineCost] Perform caller store analysis

Matt Denton via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 9 12:07:17 PDT 2019


mpdenton added a comment.

In D66987#1661750 <https://reviews.llvm.org/D66987#1661750>, @asbirlea wrote:

> MemorySSA applies to a single function (it is intra-procedural, but not inter-procedural I believe). I am guessing yes to manually perform the translation.


Ah yes, of course I meant inter-procedural, thanks for the clarification.

>> Also, getClobberingAccess I believe just skips no-alias Defs but can return may-alias. But don't I want something more definitive? I.e. I either want a definitive "yes this writes exactly the memory location you're querying about" or no result at all. So maybe I'd use the walker and then do a manual check to see whether we've found a definitive overwrite. Which would mean I'd be dealing the same edge cases as my current code (overlapping stores?).
> 
> Yes. It will also set a "Must" bit for a known must alias. If it set it to May, it's probably not a definitive overwrite.

Where does it set this "Must" bit? I took a look at the MemorySSA code and from what I can tell <https://llvm.org/doxygen/MemorySSA_8cpp_source.html#l02351> it doesn't do anything with the Alias result, at least in the "MemoryLoc" version?

>> So I'd think MemorySSA would probably buy me "stores from other basic blocks in the function, not just the callsite's basic block", but I'd still probably be dealing with the same edge cases, and MemorySSA brings its own can of worms.
> 
> It will probably buy you some more than that but I will guess there will be remaining edge cases and potentially a big can of worms :).

Well, hopefully it can buy us a lot without too much trouble.

> I'll try to look over this in more detail next week to understand the use case. Happy to chat as well.

Thanks!


Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D66987/new/

https://reviews.llvm.org/D66987





More information about the llvm-commits mailing list