brintos

brintos / llvm-project-archived public Read only

0
0
Text · 735 B · 19a102b Raw
23 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 42; RUN: llc < %s -mtriple=riscv64 | FileCheck %s3 4; The sub nuw produces poison if the input is not 0 or 1. We must insert a5; freeze before converting the sub to AND so that we don't propagate poison.6define i64 @foo(i64 %1) {7; CHECK-LABEL: foo:8; CHECK:       # %bb.0: # %entry9; CHECK-NEXT:    li a1, 110; CHECK-NEXT:    sub a1, a1, a011; CHECK-NEXT:    sltiu a0, a0, 212; CHECK-NEXT:    xori a1, a1, 113; CHECK-NEXT:    neg a0, a014; CHECK-NEXT:    and a0, a0, a115; CHECK-NEXT:    ret16entry:17  %.urem.i = sub nuw i64 1, %118  %.cmp.i = icmp ugt i64 %1, 119  %2 = xor i64 %.urem.i, 120  %3 = select i1 %.cmp.i, i64 0, i64 %221  ret i64 %322}23