mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +00:00
[CodeGenPrepare] Generalize inserted set from truncs to any inst.
It's been used before to avoid infinite loops caused by separate CGP optimizations undoing one another. We found one more such issue caused by r238054. To avoid it, generalize the "InsertedTruncs" set to any inst, and use it to avoid touching those again. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239938 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -14,6 +14,22 @@ define i32 @val_compare_and_swap(i32* %p, i32 %cmp, i32 %new) #0 {
|
||||
ret i32 %val
|
||||
}
|
||||
|
||||
define i32 @val_compare_and_swap_from_load(i32* %p, i32 %cmp, i32* %pnew) #0 {
|
||||
; CHECK-LABEL: val_compare_and_swap_from_load:
|
||||
; CHECK-NEXT: ldr [[NEW:w[0-9]+]], [x2]
|
||||
; CHECK-NEXT: [[LABEL:.?LBB[0-9]+_[0-9]+]]:
|
||||
; CHECK-NEXT: ldaxr [[RESULT:w[0-9]+]], [x0]
|
||||
; CHECK-NEXT: cmp [[RESULT]], w1
|
||||
; CHECK-NEXT: b.ne [[LABEL2:.?LBB[0-9]+_[0-9]+]]
|
||||
; CHECK-NEXT: stxr [[SCRATCH_REG:w[0-9]+]], [[NEW]], [x0]
|
||||
; CHECK-NEXT: cbnz [[SCRATCH_REG]], [[LABEL]]
|
||||
; CHECK-NEXT: [[LABEL2]]:
|
||||
%new = load i32, i32* %pnew
|
||||
%pair = cmpxchg i32* %p, i32 %cmp, i32 %new acquire acquire
|
||||
%val = extractvalue { i32, i1 } %pair, 0
|
||||
ret i32 %val
|
||||
}
|
||||
|
||||
define i32 @val_compare_and_swap_rel(i32* %p, i32 %cmp, i32 %new) #0 {
|
||||
; CHECK-LABEL: val_compare_and_swap_rel:
|
||||
; CHECK-NEXT: [[LABEL:.?LBB[0-9]+_[0-9]+]]:
|
||||
|
||||
Reference in New Issue
Block a user