Issue 129394
Summary Crash related to `half` with `aarch64-unknown-none` and `-fp-armv8`
Labels
Assignees
Reporter tgross35
    I haven't yet been able to reduce this any further, but the following hits an unreachable:

```llvm
; ModuleID = 'compiler_builtins.5353b839e5b95b34-cgu.22'
source_filename = "compiler_builtins.5353b839e5b95b34-cgu.22"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "aarch64-unknown-none"


; compiler_builtins::math::libm::generic::rint::rint_round
; Function Attrs: mustprogress nofree norecurse noredzone nosync nounwind willreturn memory(none)
define hidden range(i32 0, 65536) i32 @problem(i16 %0, i8 noundef range(i8 0, 4) %_round) unnamed_addr #1 {
start:
  %1 = and i16 %0, 31744
  %_7 = icmp samesign ugt i16 %1, 24576
  br i1 %_7, label %bb17, label %bb5

bb5:                                              ; preds = %start
  %_0.i.i2 = icmp sgt i16 %0, -1
 %.0.self.sroa.0.0.copyload.cast.i34 = bitcast i16 %0 to half
  %.40 = select i1 %_0.i.i2, half 0xH6400, half 0xHE400
  %.41 = select i1 %_0.i.i2, half 0xHE400, half 0xH6400
  %.42 = and i16 %0, -32768
  %2 = fadd half %.40, %.0.self.sroa.0.0.copyload.cast.i34
  %3 = fadd half %.41, %2
  %_0.i = fcmp oeq half %3, 0xH0000
  %y.0..cast = bitcast half %3 to i16
  %4 = select i1 %_0.i, i16 %.42, i16 %y.0..cast
  br label %bb17

bb17: ; preds = %bb5, %start
  %5 = phi i16 [ %4, %bb5 ], [ %0, %start ]
  %_0.sroa.0.0.insert.ext = zext i16 %5 to i32
 ret i32 %_0.sroa.0.0.insert.ext
}

attributes #1 = { "target-features"="-fp-armv8" }
```

https://llvm.godbolt.org/z/j16aove8Y
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to