[PATCH] D147020: [AA] Add a tbaa-fence intrinsic.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 12:04:41 PDT 2023


efriedma added a comment.

I don't think returning the pointer is actually helpful.  Passes dealing with memory aliasing will be walking backwards using something like MemorySSA, not pointer def-use lists, so they'll find it anyway if it's relevant.

Maybe the fence should have a size argument, to indicate the size of the object being allocated?  (It's currently not clear exactly what bytes are affected.)

I think we do need to settle the question of whether "new" also needs to call this fence... if it does, we need to measure the compile-time/performance impact on existing code, and if it doesn't, we'll likely end up with two overlapping solutions for very similar issues.



================
Comment at: llvm/lib/CodeGen/CodeGenPrepare.cpp:2357
       return optimizeGatherScatterInst(II, II->getArgOperand(1));
+    case Intrinsic::tbaa_fence: {
+      Value *ArgVal = II->getArgOperand(0);
----------------
This is killing off the fence too early; we have to keep the fence around as long as we have TBAA data, and that still exists at least though ISel.  (Not sure off the top of my head if we encode TBAA into MachineInstrs.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147020



More information about the llvm-commits mailing list