llvm-toolchain-9/llvm/test/CodeGen/RISCV
Jessica Clarke 76b9311f29 [PATCH] [LegalizeTypes][RISCV] Correctly sign-extend comparison for ATOMIC_CMP_XCHG
Summary:
Currently, the comparison argument used for ATOMIC_CMP_XCHG is legalised
with GetPromotedInteger, which leaves the upper bits of the value
undefind. Since this is used for comparing in an LR/SC loop with a
full-width comparison, we must sign extend it. We introduce a new
getExtendForAtomicCmpSwapArg to complement getExtendForAtomicOps, since
many targets have compare-and-swap instructions (or pseudos) that
correctly handle an any-extend input, and the existing function
determines the extension of the result, whereas we are concerned with
the input.

This is related to https://reviews.llvm.org/D58829, which solved the
issue for ATOMIC_CMP_SWAP_WITH_SUCCESS, but not the simpler
ATOMIC_CMP_SWAP.

Reviewers: asb, lenary, efriedma

Reviewed By: asb

Subscribers: arichardson, hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, MaskRay, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, jfb, PkmX, jocewei, psnobl, benna, Jim, s.egerton, pzheng, sameer.abuasal, apazos, luismarques, evandro, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D74453

Gbp-Pq: Name D74453-riscv-atomic_cmp_xchg.diff
2022-06-27 14:58:59 +08:00
..
add-before-shl.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
addc-adde-sube-subc.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
addcarry.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
align.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
alloca.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
alu8.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
alu16.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
alu32.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
alu64.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
analyze-branch.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
arith-with-overflow.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
atomic-cmpxchg-flag.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
atomic-cmpxchg.ll [PATCH] [LegalizeTypes][RISCV] Correctly sign-extend comparison for ATOMIC_CMP_XCHG 2022-06-27 14:58:59 +08:00
atomic-fence.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
atomic-load-store.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
atomic-rmw.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
bare-select.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
blockaddress.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
branch-relaxation.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
branch.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
bswap-ctlz-cttz-ctpop.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
byval.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
callee-saved-fpr32s.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
callee-saved-fpr64s.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
callee-saved-gprs.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-ilp32-ilp32f-common.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-ilp32-ilp32f-ilp32d-common.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-ilp32.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-ilp32d.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-ilp32f-ilp32d-common.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-lp64-lp64f-common.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-lp64-lp64f-lp64d-common.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-lp64.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-rv32f-ilp32.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calling-conv-sext-zext.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
calls.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
codemodel-lowering.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
compress-inline-asm.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
compress.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
disable-tail-calls.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
div.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-arith.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-bitmanip-dagcombines.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-br-fcmp.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-calling-conv.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-convert.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-fcmp.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-frem.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-imm.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-intrinsics.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-mem.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-previous-failure.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-select-fcmp.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
double-stack-spill-restore.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
dwarf-eh.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
exception-pointer-register.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
fixups-diff.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
fixups-relax-diff.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-arith.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-bit-preserving-dagcombines.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-bitmanip-dagcombines.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-br-fcmp.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-convert.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-fcmp.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-frem.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-imm.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-intrinsics.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-mem.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
float-select-fcmp.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
flt-rounds.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
fp128.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
frame-info.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
frame.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
frameaddr-returnaddr.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
get-setcc-result-type.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
hoist-global-addr-base.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
i32-icmp.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
imm-cse.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
imm.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
indirectbr.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
init-array.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
inline-asm-d-constraint-f.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
inline-asm-f-constraint-f.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
inline-asm-i-constraint-i1.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
inline-asm-invalid.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
inline-asm.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
interrupt-attr-args-error.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
interrupt-attr-invalid.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
interrupt-attr-nocall.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
interrupt-attr-ret-error.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
interrupt-attr.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
jumptable.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
large-stack.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
legalize-fneg.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
lit.local.cfg Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
lsr-legaladdimm.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
mattr-invalid-combination.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
mem.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
mem64.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
mul.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
musttail-call.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
option-norelax.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
option-norvc.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
option-relax.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
option-rvc.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
pic-models.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
pr40333.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
prefetch.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
readcyclecounter.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rem.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
remat.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rotl-rotr.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rv32e.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rv32i-rv64i-float-double.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rv64d-double-convert.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rv64f-float-convert.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rv64i-exhaustive-w-insts.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rv64i-tricky-shifts.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
rv64m-exhaustive-w-insts.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
sdata-limit-0.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
sdata-limit-4.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
sdata-limit-8.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
sdata-local-sym.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
select-cc.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
select-optimize-multiple.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
select-optimize-multiple.mir Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
setcc-logic.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
sext-zext-trunc.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
shift-masked-shamt.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
shifts.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
split-offsets.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
stack-realignment-unsupported.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
stack-realignment.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
tail-calls.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
target-abi-invalid.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
target-abi-valid.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
tls-models.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
umulo-128-legalisation-lowering.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
vararg.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
wide-mem.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00
zext-with-load-is-free.ll Import Upstream version 9.0.1 2022-06-27 14:52:34 +08:00