[llvm] [DirectX] Add `all` lowering (PR #105787)

David Peixotto via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 23 11:52:53 PDT 2024


================
@@ -0,0 +1,113 @@
+; RUN: opt -S -passes=dxil-intrinsic-expansion,dxil-op-lower -mtriple=dxil-pc-shadermodel6.0-library < %s | FileCheck %s
+
+; Make sure dxil operation function calls for all are generated for float and half.
+
+; CHECK-LABEL: all_bool
+; CHECK: icmp ne i1 %{{.*}}, false
+define noundef i1 @all_bool(i1 noundef %p0) {
+entry:
+  %p0.addr = alloca i8, align 1
----------------
dmpots wrote:

Is there a need for these tests to be this verbose? This is a lot of operations not involved with the actual lowering here (e.g. the alloca and load/store).

It seems like it would be cleaner to just pass the input arg to the intrinsic call like

```
define noundef i1 @all_bool(i1 noundef %p0) {
   %dx.all = call i1 @llvm.dx.all.i1(i1 %p0)
}
```

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


More information about the llvm-commits mailing list