[PATCH] D29314: [Instcombine] Combine consecutive identical fences

David Majnemer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 08:33:03 PST 2017


majnemer accepted this revision.
majnemer added a comment.

LGTM



================
Comment at: lib/Transforms/InstCombine/InstCombineCalls.cpp:3275-3276
+  if (auto *NFI = dyn_cast<FenceInst>(FI.getNextNode()))
+    if (NFI->getSynchScope() == FI.getSynchScope() &&
+        NFI->getOrdering() == FI.getOrdering())
+      return eraseInstFromFunction(FI);
----------------
I think you could just do `if (FI.isIdenticalTo(NFI))`


https://reviews.llvm.org/D29314





More information about the llvm-commits mailing list