[PATCH] D71983: [PowerPC] Set the SideEffects of branch & call instructions from 1 to 0

Zhang Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 30 23:30:07 PST 2019


ZhangKang added a comment.

In D71983#1799470 <https://reviews.llvm.org/D71983#1799470>, @hfinkel wrote:

> Do you expect any effect at all from doing this? These are all scheduling barriers?


I do the performance test just to confirm there is no degression, because this patch is not a NFC patch.
>From the definition of `hasUnmodeledSideEffects()`, we can know calling, branching and returning instructions shouldn't set hasSideEffect flag, because we can model them. 
I do this patch to fix the hasSideEffect flag, it may give us more potential optimization opportunities.

  /// Return true if this instruction has side
    /// effects that are not modeled by other flags.  This does not return true
    /// for instructions whose effects are captured by:
    ///
    ///  1. Their operand list and implicit definition/use list.  Register use/def
    ///     info is explicit for instructions.
    ///  2. Memory accesses.  Use mayLoad/mayStore.
    ///  3. Calling, branching, returning: use isCall/isReturn/isBranch.
    ///
    /// Examples of side effects would be modifying 'invisible' machine state like
    /// a control register, flushing a cache, modifying a register invisible to
    /// LLVM, etc.
    bool hasUnmodeledSideEffects() const {
      return Flags & (1ULL << MCID::UnmodeledSideEffects);
    }


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

https://reviews.llvm.org/D71983





More information about the llvm-commits mailing list