Skip to content

[PowerPC] Make verifier happy after peephole on MMA COPYs #94321

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

bzEq
Copy link
Collaborator

@bzEq bzEq commented Jun 4, 2024

No description provided.

@llvmbot
Copy link
Member

llvmbot commented Jun 4, 2024

@llvm/pr-subscribers-backend-powerpc

Author: Kai Luo (bzEq)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/94321.diff

2 Files Affected:

  • (modified) llvm/lib/Target/PowerPC/PPCMIPeephole.cpp (+3)
  • (modified) llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll (+36-7)
diff --git a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
index c6db8a7bbeb85..24fe8fa1d5830 100644
--- a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
@@ -448,6 +448,9 @@ void PPCMIPeephole::convertUnprimedAccPHIs(
       if (MRI->isSSA())
         addRegToUpdate(RegMBB.first.getReg());
     }
+    // The liveness of old PHI and new PHI have to be updated.
+    addRegToUpdate(PHI->getOperand(0).getReg());
+    addRegToUpdate(AccReg);
     ChangedPHIMap[PHI] = NewPHI.getInstr();
     LLVM_DEBUG(dbgs() << "Converting PHI: ");
     LLVM_DEBUG(PHI->dump());
diff --git a/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll b/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll
index 7ce5240e55bff..90a98377609e1 100644
--- a/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll
+++ b/llvm/test/CodeGen/PowerPC/peephole-mma-phi-liveness.ll
@@ -1,14 +1,43 @@
-;REQUIRES: asserts
-;RUN: not --crash llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix < %s 2>&1 | FileCheck %s
-
-;CHECK: %[[PHI1:[0-9]+]]:accrc = PHI
-;CHECK: %[[PHI0:[0-9]+]]:uaccrc = PHI
-;CHECK: Virtual register %[[PHI0]] is not needed live through the block.
-;CHECK: Virtual register %[[PHI1]] must be live through the block.
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+;RUN: llc -verify-machineinstrs -mtriple=powerpc64-ibm-aix < %s 2>&1 | FileCheck %s
 
 target datalayout = "E-m:a-Fi64-i64:64-n32:64-S128-v256:256:256-v512:512:512"
 
 define void @baz(i64 %arg) local_unnamed_addr #0 {
+; CHECK-LABEL: baz:
+; CHECK:       # %bb.0: # %bb
+; CHECK-NEXT:    xxmfacc 0
+; CHECK-NEXT:    xxmrgld 0, 0, 2
+; CHECK-NEXT:    xxlxor 1, 1, 1
+; CHECK-NEXT:    xvnegdp 2, 0
+; CHECK-NEXT:    xvnegdp 0, 0
+; CHECK-NEXT:    xvsubdp 2, 2, 1
+; CHECK-NEXT:    xvsubdp 0, 0, 3
+; CHECK-NEXT:    xvmuldp 2, 2, 1
+; CHECK-NEXT:    xvmuldp 0, 0, 1
+; CHECK-NEXT:    xvmaddadp 2, 1, 1
+; CHECK-NEXT:    xvmaddadp 0, 1, 1
+; CHECK-NEXT:    stxv 2, 0(3)
+; CHECK-NEXT:    stxv 0, 0(3)
+; CHECK-NEXT:    # implicit-def: $acc0
+; CHECK-NEXT:    bc 12, 20, L..BB0_2
+; CHECK-NEXT:  # %bb.1: # %bb10
+; CHECK-NEXT:    xvf64gerpp 0, 34, 0
+; CHECK-NEXT:  L..BB0_2: # %bb12
+; CHECK-NEXT:    cmpdi 3, 0
+; CHECK-NEXT:  L..BB0_3: # %bb13
+; CHECK-NEXT:    #
+; CHECK-NEXT:    bc 4, 2, L..BB0_3
+; CHECK-NEXT:  # %bb.4: # %bb14
+; CHECK-NEXT:    xxmfacc 0
+; CHECK-NEXT:    xxlxor 0, 0, 0
+; CHECK-NEXT:    xxlxor 2, 2, 2
+; CHECK-NEXT:    xvsubdp 1, 0, 1
+; CHECK-NEXT:    xvmaddadp 2, 1, 2
+; CHECK-NEXT:    xvadddp 0, 2, 0
+; CHECK-NEXT:    xxswapd 0, 0
+; CHECK-NEXT:    stxv 0, 0(3)
+; CHECK-NEXT:    blr
 bb:
   %call = tail call { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } @llvm.ppc.mma.disassemble.acc(<512 x i1> poison)
   %extractvalue = extractvalue { <16 x i8>, <16 x i8>, <16 x i8>, <16 x i8> } %call, 0

Kai Luo added 2 commits June 4, 2024 08:19
@bzEq bzEq merged commit 480a788 into llvm:main Jun 20, 2024
7 checks passed
@bzEq bzEq deleted the fix-mma-phi-liveness branch June 20, 2024 04:06
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jun 20, 2024

LLVM Buildbot has detected a new failure on builder clang-hip-vega20 running on hip-vega20-0 while building llvm at step 3 "annotate".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/123/builds/268

Here is the relevant piece of the build log for the reference:

Step 3 (annotate) failure: '../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh --jobs=' (failure)
../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh --jobs=
 in dir /work/hip-vega20-0/clang-hip-vega20/build (timeout 1200 secs)
 watching logfiles {}
 argv: [b'../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh', b'--jobs=']
 environment:
  BUILDBOT_BLAMELIST=[]
  BUILDBOT_BRANCH=main
  BUILDBOT_BUILDERNAME=clang-hip-vega20
  BUILDBOT_BUILDNUMBER=268
  BUILDBOT_CLOBBER=
  BUILDBOT_GOT_REVISION=7272881f30d1df4b1ff45de2abb8efad7f5b9cdf
  BUILDBOT_REVISION=480a788e4946ac7b313291f26bca19aa65d649f1
  BUILDBOT_SCHEDULER=main:clang,compiler-rt,libcxx,libcxxabi,libunwind,lld,llvm
  HIP_BLENDER_TEST_CCC_OVERRIDE_OPTIONS=x-ffast-math +-mcode-object-version=4 +-v
  HIP_BLENDER_TEST_PERF_THRESH=15
  HOME=/home/hip-vega20-0
  LANG=C.UTF-8
  LOGNAME=hip-vega20-0
  MAIL=/var/mail/hip-vega20-0
  NINJAOPT=-v
  OLDPWD=/home/hip-vega20-0/res.bad/test
  PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/snap/bin
  PWD=/work/hip-vega20-0/clang-hip-vega20/build
  SHELL=/bin/bash
  SHLVL=2
  SSH_CLIENT=10.1.34.141 39210 22
  SSH_CONNECTION=10.1.34.141 39210 10.216.90.123 22
  SSH_TTY=/dev/pts/0
  TERM=dumb
  USER=hip-vega20-0
  XDG_DATA_DIRS=/usr/local/share:/usr/share:/var/lib/snapd/desktop
  _=/usr/bin/buildbot-worker
 using PTY: False
++ dirname ../llvm-zorg/zorg/buildbot/builders/annotated/hip-build.sh
+ HERE=../llvm-zorg/zorg/buildbot/builders/annotated
+ . ../llvm-zorg/zorg/buildbot/builders/annotated/buildbot-helper.sh
+ set -eu
+ halt_on_failure
+ echo @@@HALT_ON_FAILURE@@@
+ setup_env
+ build_step 'Setting up the buildbot'
+ echo '@@@BUILD_STEP Setting up the buildbot@@@'
+ BUILDBOT_ROOT=/buildbot
Step 12 (Testing HIP test-suite) failure: Testing HIP test-suite (failure)
@@@BUILD_STEP Testing HIP test-suite@@@
+ ninja -v check-hip-simple
[0/1] cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
-- Testing: 6 tests, 6 workers --
/usr/bin/strip: /bin/bash.stripped: Bad file descriptor
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.
FAIL: test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test (5 of 6)
******************** TEST 'test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test' FAILED ********************

/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/timeit-target --timeout 7200 --limit-core 0 --limit-cpu 7200 --limit-file-size 209715200 --limit-rss-size 838860800 --append-exitstatus --redirect-output /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out --redirect-input /dev/null --summary /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.time /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/InOneWeekend-hip-6.0.2
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP ; /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2

+ cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP
+ /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP/Output/InOneWeekend-hip-6.0.2.test.out InOneWeekend.reference_output-hip-6.0.2
/buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/tools/fpcmp-target: Comparison failed, textual difference between 'M' and 'i'

********************
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 
********************
Failed Tests (1):
  test-suite :: External/HIP/InOneWeekend-hip-6.0.2.test


Testing Time: 50.74s

Total Discovered Tests: 6
  Passed: 5 (83.33%)
  Failed: 1 (16.67%)
FAILED: External/HIP/CMakeFiles/check-hip-simple-hip-6.0.2 
cd /buildbot/hip-vega20-0/clang-hip-vega20/test-suite-build/External/HIP && /buildbot/hip-vega20-0/clang-hip-vega20/llvm/bin/llvm-lit -sv empty-hip-6.0.2.test with-fopenmp-hip-6.0.2.test saxpy-hip-6.0.2.test InOneWeekend-hip-6.0.2.test TheNextWeek-hip-6.0.2.test blender.test
ninja: build stopped: subcommand failed.
program finished with exit code 1
elapsedTime=158.980199

AlexisPerry pushed a commit to llvm-project-tlp/llvm-project that referenced this pull request Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants