Skip to content

Revert "[InitUndef] handleSubReg should skip artificial subregs. (#116248)" #117365

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

Conversation

vitalybuka
Copy link
Collaborator

Maybe not needed but to avoid conflicts with #117307
Without revert of this one, but reverting #117307, the
regenerated init-undef.mir became empty.

This reverts commit be15fd5.

Created using spr 1.3.4
@vitalybuka vitalybuka added skip-precommit-approval PR for CI feedback, not intended for review and removed backend:AArch64 labels Nov 22, 2024
@vitalybuka vitalybuka merged commit 1683f84 into main Nov 22, 2024
8 of 9 checks passed
@vitalybuka vitalybuka deleted the users/vitalybuka/spr/revert-initundef-handlesubreg-should-skip-artificial-subregs-116248 branch November 22, 2024 19:24
@llvmbot
Copy link
Member

llvmbot commented Nov 22, 2024

@llvm/pr-subscribers-backend-aarch64

Author: Vitaly Buka (vitalybuka)

Changes

Maybe not needed but to avoid conflicts with #117307
Without revert of this one, but reverting #117307, the
regenerated init-undef.mir became empty.

This reverts commit be15fd5.


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

2 Files Affected:

  • (modified) llvm/lib/CodeGen/InitUndef.cpp (-8)
  • (modified) llvm/test/CodeGen/AArch64/init-undef.mir (+1-2)
diff --git a/llvm/lib/CodeGen/InitUndef.cpp b/llvm/lib/CodeGen/InitUndef.cpp
index d8b3190f31003e..d4ac131a32a959 100644
--- a/llvm/lib/CodeGen/InitUndef.cpp
+++ b/llvm/lib/CodeGen/InitUndef.cpp
@@ -164,14 +164,6 @@ bool InitUndef::handleSubReg(MachineFunction &MF, MachineInstr &MI,
     TRI->getCoveringSubRegIndexes(*MRI, TargetRegClass, NeedDef,
                                   SubRegIndexNeedInsert);
 
-    // It's not possible to create the INIT_UNDEF when there is no register
-    // class associated for the subreg. This may happen for artificial subregs
-    // that are not directly addressable.
-    if (any_of(SubRegIndexNeedInsert, [&](unsigned Ind) -> bool {
-          return !TRI->getSubRegisterClass(TargetRegClass, Ind);
-        }))
-      continue;
-
     Register LatestReg = Reg;
     for (auto ind : SubRegIndexNeedInsert) {
       Changed = true;
diff --git a/llvm/test/CodeGen/AArch64/init-undef.mir b/llvm/test/CodeGen/AArch64/init-undef.mir
index c9d23006d35234..7935c09d7df5ec 100644
--- a/llvm/test/CodeGen/AArch64/init-undef.mir
+++ b/llvm/test/CodeGen/AArch64/init-undef.mir
@@ -1,6 +1,5 @@
 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
-# RUN: llc -mtriple=aarch64-- -aarch64-enable-subreg-liveness-tracking=false -run-pass=init-undef -o - %s | FileCheck %s
-# RUN: llc -mtriple=aarch64-- -aarch64-enable-subreg-liveness-tracking=true -run-pass=init-undef -o - %s | FileCheck %s
+# RUN: llc -mtriple=aarch64-- -run-pass=init-undef -o - %s | FileCheck %s
 
 ---
 name:            test_stxp_undef

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip-precommit-approval PR for CI feedback, not intended for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants