forked from OSchip/llvm-project
[X86] Add a test case showing failure to use the RMW form of ADC when the load is in operand 1 going into isel.
The ADC instruction is commutable, but we only have RMW isel patterns with a load on the left hand side. Nothing will canonicalize loads to the LHS on these ops. So we need two patterns. llvm-svn: 341605
This commit is contained in:
parent
8c4db5da5f
commit
37d68e4599
|
@ -14,6 +14,34 @@ entry:
|
|||
ret i128 %0
|
||||
}
|
||||
|
||||
define void @add128_rmw(i128* %a, i128 %b) nounwind {
|
||||
; CHECK-LABEL: add128_rmw:
|
||||
; CHECK: # %bb.0: # %entry
|
||||
; CHECK-NEXT: addq %rsi, (%rdi)
|
||||
; CHECK-NEXT: adcq %rdx, 8(%rdi)
|
||||
; CHECK-NEXT: retq
|
||||
entry:
|
||||
%0 = load i128, i128* %a
|
||||
%1 = add i128 %0, %b
|
||||
store i128 %1, i128* %a
|
||||
ret void
|
||||
}
|
||||
|
||||
define void @add128_rmw2(i128 %a, i128* %b) nounwind {
|
||||
; CHECK-LABEL: add128_rmw2:
|
||||
; CHECK: # %bb.0: # %entry
|
||||
; CHECK-NEXT: addq (%rdx), %rdi
|
||||
; CHECK-NEXT: adcq 8(%rdx), %rsi
|
||||
; CHECK-NEXT: movq %rdi, (%rdx)
|
||||
; CHECK-NEXT: movq %rsi, 8(%rdx)
|
||||
; CHECK-NEXT: retq
|
||||
entry:
|
||||
%0 = load i128, i128* %b
|
||||
%1 = add i128 %a, %0
|
||||
store i128 %1, i128* %b
|
||||
ret void
|
||||
}
|
||||
|
||||
define i256 @add256(i256 %a, i256 %b) nounwind {
|
||||
; CHECK-LABEL: add256:
|
||||
; CHECK: # %bb.0: # %entry
|
||||
|
|
Loading…
Reference in New Issue