User Details
- User Since
- Nov 20 2020, 12:33 AM (121 w, 6 d)
Oct 31 2021
Ping.
Aug 31 2021
Ping.
Aug 19 2021
Thanks MaskRay for your review comments!
Aug 18 2021
Fix Windows gnu section name and test case
Aug 6 2021
Aug 4 2021
Change selection of entry block text section from IMAGE_COMDAT_SELECT_ANY to return value of getSelectionForCOFF()
Aug 3 2021
@jpienaar Could you please have a review?
Aug 2 2021
Jul 21 2021
@rnk could you please have a review of IMAGE_COMDAT_SELECT_XXX modification?
Jul 13 2021
Change select of BB sections to IMAGE_COMDAT_SELECT_NODUPLICATES
Jul 12 2021
Thanks @modimo for big help!
Any other review comment?
Jul 6 2021
git rebase
Update dependent D99487
git rebase
Yes.
Could you please review this commit further?
Jul 1 2021
Thanks for your big help!
Fix the typo of comment
Update test for reproducing build error of "<unknown>:0: error: Cannot represent this expression" and fix the error
Jun 28 2021
I set D99487 as this patch's parent according to @tmsriram 's comment, it's the reason why the auto test passed but you pull only this down locally and run this test crash. The section of SwitchSection() is created by D99487.
I submitted BBS patches according to purpose:
D99487 (parent of the below two patches): BBS basic function on Windows D100735 (this patch): BBS exception handling on Windows D101421: BBS DebugInfo on Windows
So the upper mentioned bug "with BBS, build fail with "error: Cannot represent this expression", I'm investigating this error" belongs to this patch.
Fix comment format of test
Jun 27 2021
This bug depends on #D99487 and this commit, can't be reproduced without these two commits. Is it ok file the bug after landing these two commits?
I don't know the reason MBB->setIsEHPad() without any MI of the MBB setIsEHLabel() in the case of Windows COFF.
My cursory understanding is that Windows COFF in LLVM uses a different set of intrinsics to represent EH which probably don't fall under EHLabel. There's probably a good reason for that. If this is the case then probably better to guard it like you're currently doing from scanning wastefully. I would guard with if (!<triple for windows>) rather specifically checking for ELF. Also, put the check inside avoidZeroOffsetLandingPad rather than the call to it so the call site doesn't have to be aware of this.
Thanks for your analysis! I changed code according to your guidance.
Add comment for difference of section number of BASELINE and BBS
Change CHECK format of test to COMMON, BASELINE, BBS for highlighting difference of BASELINE and BBS.
Change triple condition from COFF to Windows.
Move check of Windows inside avoidZeroOffsetLandingPad.
Add iterator end check for avoiding infinite loop.
Jun 24 2021
I reported bugs of using clang-cl and lld to test https://github.com/microsoft/compiler-tests/tree/master/seh
- clang-cl.exe + lld linker
I added baseline (without BBS) case and check the size of the Sections table.
I tried to build with clang, define it as "main" and add printf to the __except clause
without BBS, the exception can be captured, printf log in __except clause was printed. with BBS, build fail with "error: Cannot represent this expression", I'm investigating this error.
FYI, about avoidZeroOffsetLandingPad under MSVC, isFuncletEHPersonality(Pers) check and return of SelectionDAGISel::PrepareEHLandingPad() prevent later addLandingPad(MBB) and adding TargetOpcode::EH_LABEL MachineInstr in the case of MSVC. while (!MI->isEHLabel()) ++MI; of avoidZeroOffsetLandingPad is dead loop as no EHLabel MI in the case of MSVC.
I'm not sure what you mean by dead loop for while (!MI->isEHLabel()) Can you elaborate?
The dead loop occurs if "MBB->setIsEHPad() but all MIs of the MBB are not isEHLabel()", as condition !MI->isEHLabel() of while loop is always true.
Adding "&& MI != MBB.end()" to while (!MI->isEHLabel()) will resolve this dead loop.
The iterator is rolling loop, begin() is next to end(), the '++' operation change the iterator in loop turn, e.g. if size() is 2, the turn of '++' operation is:
begin() (1st node) -> 2nd node -> end() -> begin() (1st node) -> 2nd node -> ....
I don't know the reason MBB->setIsEHPad() without any MI of the MBB setIsEHLabel() in the case of Windows COFF.
Add baseline case and check size of the Sections table
Jun 23 2021
I'll file these bugs and try to bucket the failures in parallel.
Jun 22 2021
Make clang option -fbasic-block-sections and -funique-basic-block-section-names available on Windows COFF.
Thanks for your comment!
No big difference. There are 12 more sections in Sections table, I checked asm file, there are 12 BB sections, so all added sections are BB sections. And as the test file CHECK, one relocation of .xdata section changed from ".text" to "?TestCPPEX@@YAXH@Z.__part.3". Is this difference need to add without -basic-block-sections=all -unique-basic-block-section-names case for highlight the difference?
FYI, about avoidZeroOffsetLandingPad under MSVC, isFuncletEHPersonality(Pers) check and return of SelectionDAGISel::PrepareEHLandingPad() prevent later addLandingPad(MBB) and adding TargetOpcode::EH_LABEL MachineInstr in the case of MSVC. while (!MI->isEHLabel()) ++MI; of avoidZeroOffsetLandingPad is dead loop as no EHLabel MI in the case of MSVC.
Jun 16 2021
Sorry for late feedback of this comment!
I checked the microsoft SEH tests with
- cl.exe
Jun 15 2021
Thanks for your review comments!
Jun 8 2021
Change condition from MachineBasicBlock is begin section to MachineFunction has BB sections and add comment
Jun 7 2021
Don't emit location of BB sections
Jun 1 2021
Disable .cv_loc directive emission outside the primary function section.
May 20 2021
May 19 2021
May 11 2021
git rebase
git rebase
git rebase
May 10 2021
Remove same modification of D100735
Remove same modification of parent D99487 and add .cv_inline_linetable to test
May 7 2021
The x64 debian failed was introduced by D101797 and is being fixed by https://reviews.llvm.org/rG72bd0116e3a1a70fb52fc47c056349b290ce2204
Remove content of parent D99487 for applying this patch
Remove content of parent D99487 for applying this patch
git rebase for triggering auto test
git rebase for triggering auto test
Remove if mingw conditionals of MBB sections.
Move test back to clang/test/CodeGen/
git rebase
git rebase
Change selection of the auxilliary MBB sections to IMAGE_COMDAT_SELECT_ASSOCIATIVE, git rebase, fix comdat name issue
May 6 2021
Thanks Pengfei for your review comments!
Move test from clang/test to llvm/test, remove comma of the last enum item.
Could you please have a review?
Apr 30 2021
Thanks all!
I'll take leave between 5.1~5.6 for national holiday and personal affair, I'll response @rnk 's review comment and other further review comment after then.
Thanks for your review comment!
I'll take leave between 5.1~5.6 for national holiday and personal affair, I'll response further review comment after then.
Forgot .section directives in the first CHECK of the last update
Add .section directives test
Apr 29 2021
Apr 28 2021
Apr 27 2021
Hi tmsriram, MaskRay,
Could you please have a review?
Apr 20 2021
As the entire assembly has 500 lines, I sent to you through mail, I'll do if you think paste part of them or entire assembly to here is better.
Apr 18 2021
git rebase
Apr 16 2021
Apr 15 2021
Hi sammccall,
git rebase
Simplify text section name code
Apr 14 2021
Thanks! I got the importance.
As for DebugInfo, I tried to add "--basic-block-sections=all" to RUN of llvm/test/DebugInfo/COFF/comdat.ll, text sections includes basic block text sections and CodeViewDebugInfo can be created correctly after
- apply this patch
- commenting out a Linux exception handling protocol dependent function which I plan to do in later basic block section Windows exception handling patch.
There are some non-blocking errors "error: all .cv_loc directives for a function must be in the same section" in llc stage, one error for each basic block, below is the first one.
f.__part.1: # %if.then
#DEBUG_VALUE: f:c <- $ecx
<unknown>:0: error: all .cv_loc directives for a function must be in the same section
.Ltmp3:
I added "TODO:" for constructing exception section and cold section later.
Add TODO for constructing exception section and cold section later
Apr 5 2021
Hi tmsriram, MaskRay,
Mar 31 2021
git rebase
Simplify condition of setting COFF::IMAGE_SCN_LNK_COMDAT
Conditionally set COFF::IMAGE_SCN_LNK_COMDAT, add mtriple x86_64-windows-gnu support
Mar 29 2021
git rebase