31 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt -S -passes='require<profile-summary>,function(codegenprepare)' -mtriple=riscv64 %s \3; RUN: | FileCheck --check-prefixes=CHECK %s4 5define i16 @sink_trunc1(i64 %a) {6; CHECK-LABEL: @sink_trunc1(7; CHECK-NEXT: fnend:8; CHECK-NEXT: [[TMP0:%.*]] = trunc i64 [[A:%.*]] to i169; CHECK-NEXT: ret i16 [[TMP0]]10;11 %trunc = trunc i64 %a to i1612 br label %fnend13 14fnend:15 ret i16 %trunc16}17 18; The flags on the original trunc should be preserved.19define i16 @sink_trunc2(i64 %a) {20; CHECK-LABEL: @sink_trunc2(21; CHECK-NEXT: fnend:22; CHECK-NEXT: [[TMP0:%.*]] = trunc nuw nsw i64 [[A:%.*]] to i1623; CHECK-NEXT: ret i16 [[TMP0]]24;25 %trunc = trunc nuw nsw i64 %a to i1626 br label %fnend27 28fnend:29 ret i16 %trunc30}31