[llvm] [DXIL] Add lowering for `reversebits` and `trunc` (PR #86909)

Farzon Lotfi via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 28 06:26:42 PDT 2024


================
@@ -0,0 +1,31 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for reversebits are generated for all integer types.
+
+; Function Attrs: nounwind
+define noundef i16 @test_bitreverse_short(i16 noundef %a) #0 {
+entry:
+; CHECK:call i16 @dx.op.unary.i16(i32 30, i16 %{{.*}})
+  %elt.bitreverse = call i16 @llvm.bitreverse.i16(i16 %a)
+  ret i16 %elt.bitreverse
+}
+
+; Function Attrs: nounwind
+define noundef i32 @test_bitreverse_int(i32 noundef %a) #0 {
----------------
farzonl wrote:

remove `#0` here line 6, 22 and in trunc.ll line 5 and 12

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


More information about the llvm-commits mailing list