[PATCH] D117280: [AMDGPU] Pre-commit test for D116469. NFC

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 13 22:30:09 PST 2022


craig.topper created this revision.
craig.topper added reviewers: foad, arsenm.
Herald added subscribers: kerbowa, t-tye, tpr, dstuttard, yaxunl, nhaehnle, jvesely, kzhuravl.
craig.topper requested review of this revision.
Herald added a subscriber: wdng.
Herald added a project: LLVM.

The multiply in this test is miscompiled to 0.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117280

Files:
  llvm/test/CodeGen/AMDGPU/amdgpu-mul24-knownbits.ll


Index: llvm/test/CodeGen/AMDGPU/amdgpu-mul24-knownbits.ll
===================================================================
--- llvm/test/CodeGen/AMDGPU/amdgpu-mul24-knownbits.ll
+++ llvm/test/CodeGen/AMDGPU/amdgpu-mul24-knownbits.ll
@@ -29,6 +29,19 @@
   ret void
 }
 
+define i32 @f(i32 %x, i32 %y) {
+; GCN-LABEL: f:
+; GCN:       ; %bb.0:
+; GCN-NEXT:    s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
+; GCN-NEXT:    v_mov_b32_e32 v0, 0
+; GCN-NEXT:    s_setpc_b64 s[30:31]
+  %xx = or i32 %x, -128 ; 0xffffff80
+  %yy = or i32 %y, -128 ; 0xffffff80
+  %r = mul i32 %xx, %yy
+  %rr = lshr i32 %r, 14
+  ret i32 %rr
+}
+
 ; Function Attrs: nounwind readnone speculatable
 declare i32 @llvm.amdgcn.workitem.id.x() #20
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117280.399898.patch
Type: text/x-patch
Size: 718 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220114/d155dd2b/attachment.bin>


More information about the llvm-commits mailing list