[llvm] [AArch64][InstCombine] Eliminate redundant barrier intrinsics (PR #112023)
Paul Walker via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 14 10:59:44 PDT 2024
================
@@ -2150,13 +2150,42 @@ static std::optional<Instruction *> instCombineSVEInsr(InstCombiner &IC,
return std::nullopt;
}
+static std::optional<Instruction *> instCombineDMB(InstCombiner &IC,
+ IntrinsicInst &II) {
+ // If this barrier is post-dominated by identical one we can remove it
+ auto *NI = II.getNextNonDebugInstruction();
+ int LookaheadThreshold = 10;
+ auto CanSkipOver = [](Instruction *I) {
+ return !I->mayReadOrWriteMemory() && !I->mayHaveSideEffects();
----------------
paulwalker-arm wrote:
Perhaps I'm being paranoid but what about things like `willreturn` because the currently implementation means a `dmb` before a non-returning call will never get executed. This might signify user error, but given a missing `dmb` will be very hard to track down I feel like it's worth playing it say.
Does your use case concern crossing (non intrinsic) function call boundaries, if not then probably best to consider them as something that cannot be skipped over?
https://github.com/llvm/llvm-project/pull/112023
More information about the llvm-commits
mailing list