Displaying 20 results from an estimated 26 matches for "atomic_cmp_swap".
2018 Jan 06
0
RFC: Legalize input operand to ATOMIC_CMP_SWAP* by zero-extending
I've already posted a patch (https://reviews.llvm.org/D41791) to do this,
but here's a bit of a background.
When the operands of an ISD::ATOMIC_CMP_SWAP{_WITH_SUCCESS} are legalized
by promoting to a larger type, they're extended without specifying whether
it's a sign or zero extension. However, an analogous node (SETCC) is
legalized by zero-extending when the comparison code is for an equality
comparison.
The current legalization scheme l...
2014 Jun 13
2
[LLVMdev] RFC: add "cmpxchg weak" to LLVM IR
Hi Chandler,
> So, I see where you're going here, but I'm curious -- why not just switch
> ATOMIC_CMP_SWAP to have a second i1 value, and still be strong? Is this
> *just* to support expanding? I wonder if that's really useful rather than
> just lowering it directly on the various targets....
I tried that originally, but quickly got into murky waters with all
the targets I've got basicall...
2014 Jun 12
6
[LLVMdev] RFC: add "cmpxchg weak" to LLVM IR
...rm. Additionally, this extra bit actually exists on most
platforms even for the strong cmpxchg: on LL/SC ones by virtue of
control flow, and x86 (for example) sets ZF based on it.
Assuming that's OK, onto the DAG level. What I'd like to do is a
little odd, but makes sense I think:
1. Keep ATOMIC_CMP_SWAP with its current semantics: strong cmpxchg,
returning just the loaded value.
2. Add ATOMIC_CMP_SWAP_WITH_SUCCESS (better name suggestions welcome)
that has a second i1 value (initially) as with the IR instruction.
It's still a strong cmpxchg.
3. Expanding ATOMIC_CMP_SWAP_WITH_SUCCESS will yield...
2008 Jul 02
2
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
...ans the intrinsic is mapped to a single (pseudo) node. But it
> is then expanded into instructions that can span multiple basic
> blocks. See PPCTargetLowering::EmitInstrWithCustomInserter().
How does this look? It's a big patch, but it basically does this:
- Adds ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP and ATOMIC_SWAP nodes,
and ATOMIC_LOAD_ADD_I{32,64}, ATOMIC_CMP_SWAP_I{32,64} and
ATOMIC_SWAP_I{32,64} pseudo-instructions with custom inserters.
- Replaces L[WD]ARX and ST[WD]CX pseudo-instructions with the
actual PPC instructions they represent.
- Removes CMP_UNRESERVE nodes and CMP_...
2008 Jun 30
0
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
You need to insert new basic blocks and update CFG to accomplish this.
There is a hackish way to do this right now. Add a pseudo instruction
to represent this operation and mark it usesCustomDAGSchedInserter.
This means the intrinsic is mapped to a single (pseudo) node. But it
is then expanded into instructions that can span multiple basic
blocks. See
2008 Jul 10
2
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
...==============================================
--- lib/Target/PowerPC/PPCISelLowering.h (revision 52957)
+++ lib/Target/PowerPC/PPCISelLowering.h (working copy)
@@ -152,6 +152,11 @@
/// MTFSF = F8RC, INFLAG - This moves the register into the FPSCR.
MTFSF,
+ /// ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP, ATOMIC_SWAP - These
+ /// correspond to the llvm.atomic.load.add, llvm.atomic.cmp.swap
+ /// and llvm.atomic.swap intrinsics.
+ ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP, ATOMIC_SWAP,
+
/// LARX = This corresponds to PPC l{w|d}arx instrcution: load and
/// reserve indexed. This...
2008 Jun 30
2
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
Chris Lattner wrote:
> On Jun 27, 2008, at 8:27 AM, Gary Benson wrote:
> > def CMP_UNRESw : Pseudo<(outs), (ins GPRC:$rA, GPRC:$rB, i32imm:
> > $label),
> > "cmpw $rA, $rB\n\tbne- La${label}_exit",
> > [(PPCcmp_unres GPRC:$rA, GPRC:$rB, imm:
> > $label)]>;
> > }
> >
> > ...and
2008 Jul 08
0
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
PPCTargetLowering::EmitInstrWithCustomInserter has a reference
to the current MachineFunction for other purposes. Can you use
MachineFunction::getRegInfo instead?
Dan
On Jul 8, 2008, at 1:56 PM, Gary Benson wrote:
> Would it be acceptable to change MachineInstr::getRegInfo from private
> to public so I can use it from
> PPCTargetLowering::EmitInstrWithCustomInserter?
>
>
2008 Jul 11
2
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
...==============================================
--- lib/Target/PowerPC/PPCISelLowering.h (revision 53464)
+++ lib/Target/PowerPC/PPCISelLowering.h (working copy)
@@ -152,6 +152,11 @@
/// MTFSF = F8RC, INFLAG - This moves the register into the FPSCR.
MTFSF,
+ /// ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP, ATOMIC_SWAP - These
+ /// correspond to the llvm.atomic.load.add, llvm.atomic.cmp.swap
+ /// and llvm.atomic.swap intrinsics.
+ ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP, ATOMIC_SWAP,
+
/// LARX = This corresponds to PPC l{w|d}arx instrcution: load and
/// reserve indexed. This...
2008 Jul 11
0
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
Hi Gary,
This does not patch cleanly for me (PPCISelLowering.cpp). Can you
prepare a updated patch?
Thanks,
Evan
On Jul 10, 2008, at 11:45 AM, Gary Benson wrote:
> Cool, that worked. New patch attached...
>
> Cheers,
> Gary
>
> Evan Cheng wrote:
>> Just cast both values to const TargetRegisterClass*.
>>
>> Evan
>>
>> On Jul 10, 2008, at 7:36
2008 Jul 10
0
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
Just cast both values to const TargetRegisterClass*.
Evan
On Jul 10, 2008, at 7:36 AM, Gary Benson wrote:
> Evan Cheng wrote:
>> How about?
>>
>> const TargetRegisterClass *RC = is64Bit ? &PPC:GPRCRegClass :
>> &PPC:G8RCRegClass;
>> unsigned TmpReg = RegInfo.createVirtualRegister(RC);
>
> I tried something like that yesterday:
>
> const
2008 Jul 10
2
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
Evan Cheng wrote:
> How about?
>
> const TargetRegisterClass *RC = is64Bit ? &PPC:GPRCRegClass :
> &PPC:G8RCRegClass;
> unsigned TmpReg = RegInfo.createVirtualRegister(RC);
I tried something like that yesterday:
const TargetRegisterClass *RC =
is64bit ? &PPC::GPRCRegClass : &PPC::G8RCRegClass;
but I kept getting this error no matter how I arranged it:
2008 Jul 09
2
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
...==============================================
--- lib/Target/PowerPC/PPCISelLowering.h (revision 52957)
+++ lib/Target/PowerPC/PPCISelLowering.h (working copy)
@@ -152,6 +152,11 @@
/// MTFSF = F8RC, INFLAG - This moves the register into the FPSCR.
MTFSF,
+ /// ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP, ATOMIC_SWAP - These
+ /// correspond to the llvm.atomic.load.add, llvm.atomic.cmp.swap
+ /// and llvm.atomic.swap intrinsics.
+ ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP, ATOMIC_SWAP,
+
/// LARX = This corresponds to PPC l{w|d}arx instrcution: load and
/// reserve indexed. This...
2008 Jul 08
2
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
Would it be acceptable to change MachineInstr::getRegInfo from private
to public so I can use it from PPCTargetLowering::EmitInstrWithCustomInserter?
Cheers,
Gary
Evan Cheng wrote:
> Look for createVirtualRegister. These are examples in
> PPCISelLowering.cpp.
>
> Evan
> On Jul 8, 2008, at 8:24 AM, Gary Benson wrote:
>
> > Hi Evan,
> >
> > Evan Cheng wrote:
2009 Mar 27
1
[LLVMdev] atomic operations for ARM
...Mar 26, 2009, at 5:41 PM, Robert Schuster wrote:
> Hi,
> I have reworked my previous example and got something which is
> accepted
> by tblgen:
>
> let isCall = 1,
> Defs = [R0, R1, R2, R3, R12, LR,
> D0, D1, D2, D3, D4, D5, D6, D7, CPSR] in {
>
> def ARM_ATOMIC_CMP_SWAP : ABXI<0b1011, (outs GPR:$dst), (ins
> i32imm:$ptr, i32imm:$old, i32imm:$new),
> "do_something",
> [(set GPR:$dst,
> (atomic_cmp_swap_32 globaladdr:$ptr, imm:$old,
> imm:$new))]>;
> }
>
> What I want to achieve first is tha...
2016 Mar 28
0
RFC: atomic operations on SI+
...3,6 +263,12 @@ SITargetLowering::SITargetLowering(TargetMachine &TM,
> setOperationAction(ISD::FDIV, MVT::f32, Custom);
> setOperationAction(ISD::FDIV, MVT::f64, Custom);
>
> + // GCN CMP_SWAP needs input marshalling, and output demarshalling
> + setOperationAction(ISD::ATOMIC_CMP_SWAP, MVT::i32, Custom);
> + // We can't return success/failure, only the old value,
> + // let LLVM add the comparison
> + setOperationAction(ISD::ATOMIC_CMP_SWAP_WITH_SUCCESS, MVT::i32, Expand);
> +
> setTargetDAGCombine(ISD::FADD);
> setTargetDAGCombine(ISD::FSUB);
>...
2016 Mar 25
2
RFC: atomic operations on SI+
Hi Tom, Matt,
I'm working on a project that needs few coherent atomic operations (HSA
mode: load, store, compare-and-swap) for std::atomic_uint in HCC.
the attached patch implements atomic compare and swap for SI+
(untested). I tried to stay within what was available, but there are
few issues that I was unsure how to address:
1.) it currently uses v2i32 for both input and output. This
2011 Apr 01
0
[LLVMdev] Assert in VerifySDNode
...ics to a MemIntrinsicNode
// with either an intrinsic or a target opcode.
return N->getOpcode() == ISD::LOAD ||
N->getOpcode() == ISD::STORE ||
N->getOpcode() == ISD::PREFETCH ||
N->getOpcode() == ISD::ATOMIC_CMP_SWAP ||
N->getOpcode() == ISD::ATOMIC_SWAP ||
N->getOpcode() == ISD::ATOMIC_LOAD_ADD ||
N->getOpcode() == ISD::ATOMIC_LOAD_SUB ||
N->getOpcode() == ISD::ATOMIC_LOAD_AND ||
N->getOpcode() == ISD::ATOMIC_LOA...
2011 Apr 01
2
[LLVMdev] Assert in VerifySDNode
> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu]
> On Behalf Of Duncan Sands
> Sent: Thursday, March 31, 2011 7:43 PM
> To: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] Assert in VerifySDNode
>
> Hi Micah,
>
> > assert(!isa<MemSDNode>(N) && "Bad MemSDNode!");
>
> you
2008 Jul 04
0
[LLVMdev] Implementing llvm.atomic.cmp.swap.i32 on PowerPC
...mapped to a single (pseudo) node. But it
>> is then expanded into instructions that can span multiple basic
>> blocks. See PPCTargetLowering::EmitInstrWithCustomInserter().
>
> How does this look? It's a big patch, but it basically does this:
>
> - Adds ATOMIC_LOAD_ADD, ATOMIC_CMP_SWAP and ATOMIC_SWAP nodes,
> and ATOMIC_LOAD_ADD_I{32,64}, ATOMIC_CMP_SWAP_I{32,64} and
> ATOMIC_SWAP_I{32,64} pseudo-instructions with custom inserters.
>
> - Replaces L[WD]ARX and ST[WD]CX pseudo-instructions with the
> actual PPC instructions they represent.
>
> - Removes...