Page MenuHomePhabricator

[XCOFF][AIX] Peephole optimization in TocData transformation
Needs ReviewPublic

Authored by sfertile on Apr 28 2021, 9:28 AM.



This patch is a followup to D101178.

In the patch, we enable peephole optimization (when possible) for the toc data transformation.

For example, with this patch would allow for the following assembly code:

la 4, i[TD](2) 
stw 3, 0(4)

to be transformed to the following instead:

stw 3, i[TD](2)

This patch can only be merged in after D101178 has been accepted and merged into LLVM.

Diff Detail

Unit TestsFailed

80 msx64 debian > Clang.Driver::debug-pass-structure.c
Script: -- : 'RUN: at line 2'; /mnt/disks/ssd0/agent/llvm-project/build/bin/clang -fexperimental-new-pass-manager -fdebug-pass-structure -O3 -S -emit-llvm /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/debug-pass-structure.c -o /dev/null 2>&1 | /mnt/disks/ssd0/agent/llvm-project/build/bin/FileCheck /mnt/disks/ssd0/agent/llvm-project/clang/test/Driver/debug-pass-structure.c --check-prefix=NEWPM

Event Timeline

sidbav created this revision.Apr 28 2021, 9:28 AM
sidbav requested review of this revision.Apr 28 2021, 9:28 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 28 2021, 9:28 AM

Awesome work Sidarth, patch looks really good. I've got one initial comment.


This flag represents emitting a specific relocation (ie producing an object file) or a specific relocation specifier (if producing assembly) in this case it means emitting sym@toc@l which means the low 16-bits of the offset from the toc-pointer to 'sym'. Our symbol reference on the ADDItoc doesn't need any flags to modify it.

sidbav updated this revision to Diff 341640.Apr 29 2021, 2:22 PM

Address Review comments

sidbav marked an inline comment as done.Apr 29 2021, 2:22 PM
sidbav updated this revision to Diff 341642.Apr 29 2021, 2:24 PM

fix some formatting issues

sfertile commandeered this revision.Tue, Jun 15, 3:59 PM
sfertile edited reviewers, added: sidbav; removed: sfertile.