[all-commits] [llvm/llvm-project] 59f2dd: [MachineCSE] Prevent CSE of non-local convergent i...

Michael Kitzan via All-commits all-commits at lists.llvm.org
Fri Apr 23 16:53:49 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 59f2dd5f1acded46299cc8eee61a3af78036e140
      https://github.com/llvm/llvm-project/commit/59f2dd5f1acded46299cc8eee61a3af78036e140
  Author: Michael Kitzan <mkitzan at apple.com>
  Date:   2021-04-23 (Fri, 23 Apr 2021)

  Changed paths:
    M llvm/lib/CodeGen/MachineCSE.cpp
    A llvm/test/CodeGen/AMDGPU/GlobalISel/no-cse-nonlocal-convergent-instrs.mir

  Log Message:
  -----------
  [MachineCSE] Prevent CSE of non-local convergent instrs

At the moment, MachineCSE allows CSE-ing convergent instrs which are
non-local to each other. This can cause illegal codegen as convergent
instrs are control flow dependent. The patch prevents non-local CSE of
convergent instrs by adding a check in isProfitableToCSE and rejecting
CSE-ing if we're considering CSE-ing non-local convergent instrs. We
can still CSE convergent instrs which are in the same control flow
scope, so the patch purposely does not make all convergent instrs
non-CSE candidates in isCSECandidate.

https://reviews.llvm.org/D101187




More information about the All-commits mailing list