Skip to content

Commit 1683f84

Browse files
authored
Revert "[InitUndef] handleSubReg should skip artificial subregs. (#116248)" (#117365)
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.
1 parent 23d7a6c commit 1683f84

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

llvm/lib/CodeGen/InitUndef.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,6 @@ bool InitUndef::handleSubReg(MachineFunction &MF, MachineInstr &MI,
164164
TRI->getCoveringSubRegIndexes(*MRI, TargetRegClass, NeedDef,
165165
SubRegIndexNeedInsert);
166166

167-
// It's not possible to create the INIT_UNDEF when there is no register
168-
// class associated for the subreg. This may happen for artificial subregs
169-
// that are not directly addressable.
170-
if (any_of(SubRegIndexNeedInsert, [&](unsigned Ind) -> bool {
171-
return !TRI->getSubRegisterClass(TargetRegClass, Ind);
172-
}))
173-
continue;
174-
175167
Register LatestReg = Reg;
176168
for (auto ind : SubRegIndexNeedInsert) {
177169
Changed = true;

llvm/test/CodeGen/AArch64/init-undef.mir

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 5
2-
# RUN: llc -mtriple=aarch64-- -aarch64-enable-subreg-liveness-tracking=false -run-pass=init-undef -o - %s | FileCheck %s
3-
# RUN: llc -mtriple=aarch64-- -aarch64-enable-subreg-liveness-tracking=true -run-pass=init-undef -o - %s | FileCheck %s
2+
# RUN: llc -mtriple=aarch64-- -run-pass=init-undef -o - %s | FileCheck %s
43

54
---
65
name: test_stxp_undef

0 commit comments

Comments
 (0)