This helps fix a regression from D148309 where a shift + add was no longer combined into a ssra. It looks for add's with v1i64 extract operands and converts them to v1i64 adds. The other operand needs to be something that is easily converted to a v1i64, in this case it currently just checks for a load.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM. May benefit from an additional back to back add/sub nodes based tests and extracts out of a non <1 x i64> type
define i64 @sub_i64_ext_ext_test1(<1 x i64> %A, <2 x i64> %B) nounwind {
; CHECK-LABEL: sub_i64_ext_ext_test1:
; CHECK: %bb.0:
; CHECK-NEXT: kill: def $d0 killed $d0 def $q0
; CHECK-NEXT: mov x8, v1.d[1]
; CHECK-NEXT: fmov x9, d0
; CHECK-NEXT: fmov x10, d1
; CHECK-NEXT: sub x9, x9, x10
; CHECK-NEXT: sub x0, x9, x8
; CHECK-NEXT: ret
%a = extractelement <1 x i64> %A, i32 0 %b = extractelement <2 x i64> %B, i32 0 %c = extractelement <2 x i64> %B, i32 1 %d = sub i64 %a, %b %e = sub i64 %d, %c ret i64 %e
}