[llvm] AMDGPU: Do not assert on unhandled types when demangling libcalls (PR #120068)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 16 04:39:19 PST 2024


================
@@ -0,0 +1,22 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5
+; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=amdgpu-simplifylib -amdgpu-prelink %s | FileCheck %s
+; Make sure there are no crashes on unexpected types
+
+%struct.vfloat3 = type { float, float, float }
+
+declare hidden %struct.vfloat3 @_Z3mix7vfloat3S_f(float, float, float, float, float, float, float) #1
+
+define %struct.vfloat3 @_Z8test_mix7vfloat3S_f(float %x.coerce0, float %x.coerce1, float %x.coerce2, float %y.coerce0, float %y.coerce1, float %y.coerce2, float %t) {
+; CHECK-LABEL: define %struct.vfloat3 @_Z8test_mix7vfloat3S_f(
+; CHECK-SAME: float [[X_COERCE0:%.*]], float [[X_COERCE1:%.*]], float [[X_COERCE2:%.*]], float [[Y_COERCE0:%.*]], float [[Y_COERCE1:%.*]], float [[Y_COERCE2:%.*]], float [[T:%.*]]) {
+; CHECK-NEXT:  [[ENTRY:.*:]]
+; CHECK-NEXT:    [[CALL:%.*]] = call [[STRUCT_VFLOAT3:%.*]] @[[_Z3MIX7VFLOAT3S_F:[a-zA-Z0-9_$\"\\.-]*[a-zA-Z_$\"\\.-][a-zA-Z0-9_$\"\\.-]*]](float [[X_COERCE0]], float [[X_COERCE1]], float [[X_COERCE2]], float [[Y_COERCE0]], float [[Y_COERCE1]], float [[Y_COERCE2]], float [[T]])
+; CHECK-NEXT:    ret [[STRUCT_VFLOAT3]] [[CALL]]
+;
+entry:
+  %call = call %struct.vfloat3 @_Z3mix7vfloat3S_f(float %x.coerce0, float %x.coerce1, float %x.coerce2, float %y.coerce0, float %y.coerce1, float %y.coerce2, float  %t)
+  ret %struct.vfloat3 %call
+}
+
+
+
----------------
arsenm wrote:

```suggestion
```

https://github.com/llvm/llvm-project/pull/120068


More information about the llvm-commits mailing list