This is an archive of the discontinued LLVM Phabricator instance.

[PowerPC] fix the PowerPC cases, NFC
ClosedPublic

Authored by shchenz on Aug 28 2023, 7:53 PM.

Details

Reviewers
MatzeB
qiucf
Group Reviewers
Restricted Project
Commits
rGa69cb2076898: [NFC] Fix the PowerPC broken cases in D152215.
Summary

Fix the broken cases in D152215.

For case test/CodeGen/PowerPC/aix-lower-jump-table.ll, the original case checks the jump table in the TOC region. update_llc_test_checks seems can not generate these assembly codes?

Diff Detail

Event Timeline

shchenz created this revision.Aug 28 2023, 7:53 PM
Herald added a project: Restricted Project. · View Herald TranscriptAug 28 2023, 7:53 PM
shchenz requested review of this revision.Aug 28 2023, 7:53 PM
shchenz retitled this revision from [PowerPC] fix the PowerPC cases to [PowerPC] fix the PowerPC cases, NFC.Aug 28 2023, 7:54 PM
qiucf added a subscriber: qiucf.Aug 30 2023, 2:31 AM

SMALL-ASM, LARGE-ASM and FUNC-ASM has conflicting outputs so the script cannot handle:

# FUNC-ASM
# 32-bit
lwz 4, L..C0(2)                         # %jump-table.0
slwi 3, 3, 2
lwzx 3, 3, 4

# 64-bit
ld 4, L..C0(2)                          # %jump-table.0
rldic 3, 3, 2, 30
lwax 3, 3, 4

Besides, update llc script uses r'^[_.]?(?P=func):(?:[ \t]*#+[ \t]*@"?(?P=func)"?)?\n' regex to match func: label in PPC asm, while the jump_table function here does not have such label. I doubt whether removing this check would cause regression in other cases. So I'd prefer keep cases here as manual.

qiucf accepted this revision as: qiucf.Aug 30 2023, 2:32 AM
This revision is now accepted and ready to land.Aug 30 2023, 2:32 AM

SMALL-ASM, LARGE-ASM and FUNC-ASM has conflicting outputs so the script cannot handle:

# FUNC-ASM
# 32-bit
lwz 4, L..C0(2)                         # %jump-table.0
slwi 3, 3, 2
lwzx 3, 3, 4

# 64-bit
ld 4, L..C0(2)                          # %jump-table.0
rldic 3, 3, 2, 30
lwax 3, 3, 4

Besides, update llc script uses r'^[_.]?(?P=func):(?:[ \t]*#+[ \t]*@"?(?P=func)"?)?\n' regex to match func: label in PPC asm, while the jump_table function here does not have such label. I doubt whether removing this check would cause regression in other cases. So I'd prefer keep cases here as manual.

Thanks for looking into the script @qiucf .
Except for the instruction conflcit, for SMALL-ASM, LARGE-ASM and FUNC-ASM, not sure the script can generate below checks:

; FUNC-ASM: L..JTI0_0:
; FUNC-ASM:         .vbyte  4, L..BB0_2-L..JTI0_0
; FUNC-ASM:         .vbyte  4, L..BB0_4-L..JTI0_0
; FUNC-ASM:         .vbyte  4, L..BB0_5-L..JTI0_0
; FUNC-ASM:         .vbyte  4, L..BB0_6-L..JTI0_0

; SMALL-ASM: .toc
; SMALL-ASM: .tc L..JTI0_0[TC],L..JTI0_0

; LARGE-ASM: .toc
; LARGE-ASM: .tc L..JTI0_0[TE],L..JTI0_0

These assembly codes are the testing points for the test.

This revision was automatically updated to reflect the committed changes.