[PATCH] D158673: [SDAG][RISCV] Avoid neg instructions when lowering atomic_load_sub with a constant rhs

Jessica Clarke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 25 12:25:27 PDT 2023


jrtc27 added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp:3137
   }
+  case ISD::ATOMIC_LOAD_SUB: {
+    SDLoc DL(Node);
----------------
This should be conditional on what ATOMIC_LOAD_ADD is (see forced-atomics.ll for unnecessary churn, though that won't show that this _adds_ an instruction for non-constant operands, at least I assume)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158673



More information about the llvm-commits mailing list