This patch implements the load and reserve and store conditional
builtins for the PowerPC target, in order to have feature parity with
xlC on AIX.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
The wording might be inaccurate. It's better to rephrase to 'Load and Reserve and Store Conditional'.
llvm/lib/Target/PowerPC/PPCInstr64Bit.td | ||
---|---|---|
1724 | IIRC, l(w|d)arx, st(w|d)cx are supported very early and don't need altivec support. | |
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-atomicLoadStore-64-only.ll | ||
7 ↗ | (On Diff #355701) | Is -mcpu=pwr9 necessary? |
llvm/include/llvm/IR/IntrinsicsPowerPC.td | ||
---|---|---|
1536–1537 | Is there an unintended change at the end? | |
llvm/lib/Target/PowerPC/PPCInstrPrefix.td | ||
2841 ↗ | (On Diff #355701) | Why are these patterns in PPCInstrPrefix.td? Shouldn't they be in PPCInstrInfo.td? |
llvm/lib/Target/PowerPC/PPCInstr64Bit.td | ||
---|---|---|
1724 | Agreed. This does not require ISA 2.07 and definitely doesn't require Altivec. |
Please add the 64 bit only sema check & error test case for the two 64 bit only builtins ldarx and stdcx
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-LoadReserve-StoreCond-64-only.ll | ||
---|---|---|
10 ↗ | (On Diff #356533) | remove local_unnamed_addr #0 |
22 ↗ | (On Diff #356533) | remove local_unnamed_addr #0 |
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-LoadReserve-StoreCond.ll | ||
13 | remove local_unnamed_addr #0 | |
31 | remove local_unnamed_addr #0 |
Overall I think this is fine. I just have a few nits.
clang/test/CodeGen/builtins-ppc-xlcompat-LoadReseve-StoreCond.c | ||
---|---|---|
12 | Please check that this "entry:" is printed out when asserts are on and when asserts are off you may want to remove it at this point. I would prefer you check the name of the function instead of "entry". You can use CHECK-LABEL to do that. | |
clang/test/CodeGen/builtins-ppc-xlcompat-error.c | ||
19 | This entire test is for 32 bit Power PC. There is only one run line and that is what is specified. | |
llvm/include/llvm/IR/IntrinsicsPowerPC.td | ||
1529 | nit: |
LGTM aside from a small nit.
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-LoadReserve-StoreCond-64bit-only.ll | ||
---|---|---|
3 | +1 |
llvm/test/CodeGen/PowerPC/builtins-ppc-xlcompat-LoadReserve-StoreCond-64bit-only.ll | ||
---|---|---|
3 | The AIX assembler cannot understand register prefixes, so I'll leave the test cases as is. |
Looks like this breaks tests: http://45.33.8.238/linux/50465/step_7.txt
Please take a look, and revert for now if it takes a while to fix.
Hi! I accidentally included a test case meant for a later patch; it's been removed in this patch here: https://reviews.llvm.org/D105454
llvm/include/llvm/IR/IntrinsicsPowerPC.td | ||
---|---|---|
1533 | I don't know why I missed this in the review, but this is very wrong! This is a load intrinsic that is marked as one that doesn't touch memory. |
-S seems redundant.
Any reason we need -O2 for these tests?