[PATCH] D112016: [IR] Introduce load assume operand bundle

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 11:53:54 PDT 2021


nikic requested changes to this revision.
nikic added a comment.
This revision now requires changes to proceed.

This will require changes to AA and access modelling. Normally assumes are inaccessiblememonly, but in this case the assume also reads the location of the pointer. In particular, you can not hoist or sink a store of the location across the assume, as it may invalidate the assumption. Thankfully we do have the tools to model this, because operand bundles can change AA behavior. You'd have to adjust the handling of assume in hasReadingOperandBundles() to count as an accessible memory read for load_eq operand bundles. BasicAA could then restrict it to just the passed location. However, there are also other places that explicitly skip over assume intrinsics on the assumption that they do not access accessible memory. An obvious example is MemorySSA, which does not create memory accesses for assumes (but would need to create them for load_eq), but I remember similar code existing in a few other places as well.

Generally I'd like to see the followup patches that are needed to make this actually work. A simple load+icmp assume will "just work", but this new operand bundle will need explicit support (beyond the AA modelling, hopefully only in GVN and nowhere else?)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D112016



More information about the llvm-commits mailing list