[PATCH] D120199: [X86] Use bit test instructions to optimize some logic atomic operations

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 19 23:53:09 PST 2022


pengfei added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:30495
+  case AtomicRMWInst::Or:
+    SCR = 0;
+    break;
----------------
LuoYuanke wrote:
> Use enum { BIT_SET, BIT_CLEAR, BIT_RESET} to replace {0, 1, 2}?
There's no other user, so I just add a comment here.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:30504
+  }
+  Instruction *I = AI->user_back();
+  LLVMContext &Ctx = AI->getParent()->getParent()->getContext();
----------------
LuoYuanke wrote:
> Add comments that there is only 1 user checked in shouldExpandLogicAtomicRMWInIR()?
There is it at line 30466.


================
Comment at: llvm/lib/Target/X86/X86IntrinsicsInfo.h:40
   FIXUPIMM, FIXUPIMM_MASKZ, GATHER_AVX2,
-  ROUNDP, ROUNDS
+  ROUNDP, ROUNDS, LOCK_BITTEST
 };
----------------
LuoYuanke wrote:
> It seems LOCK_BITTEST is not used?
Yes. Good catch!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120199



More information about the llvm-commits mailing list