llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
28.89k stars 11.93k forks source link

LDR_POST_IMM emits code as could not recognize #16731

Closed linzj closed 2 years ago

linzj commented 11 years ago
Bugzilla Link 16357
Resolution DUPLICATE
Resolved on Oct 18, 2013 19:37
Version trunk
OS Linux
CC @isanbard

Extended Description

LDR_POST_IMM emits texts like that: ldr r2, [r5], #​4 str r2, [r0], #​4 subs r1, r1, #​4 bne .LBB35_1 which couldn't be recognized by binutils' as. And these code are generated by memcpy. Is that normal? And I tried to change its definition from: def _POST_IMM : AI2ldstidx<0, isByte, 0, (outs GPR:$Rn_wb), (ins GPR:$Rt, addr_offset_none:$addr, am2offset_imm:$offset), IndexModePost, StFrm, iii, opc, "\t$Rt, $addr, $offset", "$addr.base = $Rn_wb", []> { to: def _POST_IMM : AI2ldstidx<0, isByte, 0, (outs GPR:$Rn_wb), (ins GPR:$Rt, addr_offset_none:$addr, am2offset_imm:$offset), IndexModePost, StFrm, iii, opc, "\t$Rt, $addr!", "$addr.base = $Rn_wb", []> { and llvm seemed to generate the acceptable code: ldr r2, [r5]! str r2, [r0]!

linzj commented 2 years ago

mentioned in issue llvm/llvm-bugzilla-archive#16545

linzj commented 11 years ago

This bug has been marked as a duplicate of bug llvm/llvm-bugzilla-archive#16545

isanbard commented 11 years ago

Manjian, This might be something to email to the llvm-commits list as a patch. Please provide a testcase.