[llvm] [SandboxVec][DAG] Build actual dependencies (PR #111094)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 8 08:16:01 PDT 2024


================
@@ -86,13 +88,20 @@ class DGNode {
            (!(II = dyn_cast<IntrinsicInst>(I)) || isMemIntrinsic(II));
   }
 
+  /// \Returns true if \p I is fence like. It excludes non-mem intrinsics.
+  static bool isFenceLike(Instruction *I) {
+    IntrinsicInst *II;
+    return I->isFenceLike() &&
+           (!(II = dyn_cast<IntrinsicInst>(I)) || isMemIntrinsic(II));
+  }
+
   /// \Returns true if \p I is a memory dependency candidate instruction.
   static bool isMemDepNodeCandidate(Instruction *I) {
     AllocaInst *Alloca;
     return isMemDepCandidate(I) ||
            ((Alloca = dyn_cast<AllocaInst>(I)) &&
             Alloca->isUsedWithInAlloca()) ||
-           isStackSaveOrRestoreIntrinsic(I);
+           isStackSaveOrRestoreIntrinsic(I) || isFenceLike(I);
----------------
vporpo wrote:

None of them are in Utils any more, all were moved here.

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


More information about the llvm-commits mailing list