18 lines · plain
1; RUN: llc -mtriple=arm64-apple-darwin < %s | FileCheck %s2; Check that the peephole optimizer knows about sext and zext instructions.3; CHECK: test1sext4define i32 @test1sext(i64 %A, i64 %B, ptr %P, ptr %P2) nounwind {5 %C = add i64 %A, %B6 ; CHECK: add x[[SUM:[0-9]+]], x0, x17 %D = trunc i64 %C to i328 %E = shl i64 %C, 329 %F = ashr i64 %E, 3210 ; CHECK: sxtw x[[EXT:[0-9]+]], w[[SUM]]11 store volatile i64 %F, ptr %P212 ; CHECK: str x[[EXT]]13 store volatile i32 %D, ptr %P14 ; Reuse low bits of extended register, don't extend live range of SUM.15 ; CHECK: str w[[SUM]]16 ret i32 %D17}18