[PATCH] D137711: [X86] Use lock add/sub for cases that we only care about the EFLAGS
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 9 10:33:09 PST 2022
RKSimon added inline comments.
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:31340
+ return Pred == CmpInst::ICMP_EQ;
+ if (match(I, m_c_Add(m_Specific(Op), m_Value())) && I->hasOneUse() &&
+ match(I->user_back(), m_ICmp(Pred, m_Value(), m_ZeroInt())))
----------------
m_OneUse(m_c_Add(...)) ?
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:31348
+ return Pred == CmpInst::ICMP_EQ;
+ if (match(I, m_Sub(m_Value(), m_Specific(Op))) && I->hasOneUse() &&
+ match(I->user_back(), m_ICmp(Pred, m_Value(), m_ZeroInt())))
----------------
m_OneUse(m_Sub(...))?
================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:31368
+ X86::CondCode CC =
+ ICI->getPredicate() == CmpInst::ICMP_EQ ? X86::COND_E : X86::COND_S;
+ Intrinsic::ID IID = Intrinsic::not_intrinsic;
----------------
assert ICI->getPredicate() for EQ/SLT ?
================
Comment at: llvm/test/CodeGen/X86/pr58685.ll:4
+
+define dso_local noundef zeroext i1 @_Z13lock_add_seteRSt6atomicIjEj(ptr nocapture noundef nonnull align 4 dereferenceable(4) %0, i32 noundef %1) local_unnamed_addr #0 {
+; CHECK-LABEL: _Z13lock_add_seteRSt6atomicIjEj:
----------------
Cleanup the method names and drop the dso_local / atttributes etc?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D137711/new/
https://reviews.llvm.org/D137711
More information about the llvm-commits
mailing list