[PATCH] D137381: [clang][compiler-rt] Exception escape out of an non-unwinding function is an undefined behaviour

2022-12-06 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added inline comments. Comment at: clang/test/CodeGen/windows-seh-EHa-CppCondiTemps.cpp:3 +// FIXME: this check appears to be miscompiled? +// XFAIL: * lebedev.ri wrote: > efriedma wrote: > > lebedev.ri wrote: > > > tentzen wrote: > > > > lebedev.ri wro

[PATCH] D137381: [clang][compiler-rt] Exception escape out of an non-unwinding function is an undefined behaviour

2022-12-04 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added inline comments. Comment at: clang/test/CodeGen/windows-seh-EHa-CppCondiTemps.cpp:3 +// FIXME: this check appears to be miscompiled? +// XFAIL: * lebedev.ri wrote: > This test broke once we always started adding (outermost) UB scope for > nounwin

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2022-04-18 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#3453565 , @bowang wrote: >> Hi, this patch is just part-1 of Windows SEH feature support. Part-2 work >> had been sitting in https://reviews.llvm.org/D102817/new/ since last May >> 2021. It's been reviewed, and feedba

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2022-04-14 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#3450940 , @bowang wrote: > Any updates on this patch? Would like to see it moving forward. > > I was trying to use Google Breakpad with Clang. Breakpad is a crash handling > library that generates a minidump at crash. Th

[PATCH] D103664: [Windows SEH]: Fix -O2 crash for Windows -EHa

2021-06-04 Thread Ten Tzen via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG33ba8bd2c942: [Windows SEH]: Fix -O2 crash for Windows -EHa (authored by tentzen). Repository: rG LLVM Github Monorepo

[PATCH] D103664: [Windows SEH]: Fix -O2 crash for Windows -EHa

2021-06-04 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. since I cannot repro it locally, let's have this patch in to resolve -EHa -O2 crashes for now. I will add more -O2 tests in following patches. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103664/new/ https://reviews.llvm.

[PATCH] D103664: [Windows SEH]: Fix -O2 crash for Windows -EHa

2021-06-04 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. @zahiraam, are you removing all those CHECKs: - CHECK: invoke void @llvm.seh.scope.** those are placed there to ensure SEH scope semantic is preserved for Od.. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103664/new/ htt

[PATCH] D103664: [Windows SEH]: Fix -O2 crash for Windows -EHa

2021-06-04 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 349939. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103664/new/ https://reviews.llvm.org/D103664 Files: clang/lib/CodeGen/CGCleanup.cpp clang/lib/Driver/ToolChains/Clang.cpp Index: clang/lib/Driver/ToolC

[PATCH] D103664: [Windows SEH]: Fix -O2 crash for Windows -EHa

2021-06-04 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D103664#2798732 , @aganea wrote: > Thanks for the quick fix! Would you mind fixing the two failing tests please? > (see above) Hmm, I cannot repro locally.. @zahiraam, currently -EHa is not completely ready yet. we need a co

[PATCH] D103664: [Windows SEH]: Fix -O2 crash for Windows -EHa

2021-06-03 Thread Ten Tzen via Phabricator via cfe-commits
tentzen created this revision. tentzen added reviewers: asmith, aganea, zahiraam. tentzen requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This patch fixes a Windows -EHa crash induced by previous commit 797ad701522988e212495285dade8efac41a

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-06-03 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. @aganea Oh, my mistake. did not mean to enable -fasync-exceptions under -EHa in this patch. will fix it shortly... Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 _

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-06-03 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Hi, yes I can repro the crash with -fasync-exceptions plus -O2 option. Working on it now.. thank you for reporting this bug.. @aganea , this patch should be zero-impact without explicit option -fasync-exceptions. Are you also seeing a crash without this option? thanks

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-05-16 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Passed many CodeGen related test suites over the weekend. It landed in.. commit 9ca9be098fedb14182c50c9dd700f3fa91c8d4c7 (HEAD -> main) Author: Ten Tzen Date: Sun May 16 18:12:47 2021 -0700 [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1 Repository

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-04-14 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. bool keepFramePointer(const MachineFunction &MF) const override; In D80344#2673335 , @lebedev.ri wrote: > In D80344#2673148 , @asmith wrote: > >> In D80344#2671157

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-04-12 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Hi, (Last call for review!!) Is there any more comments? This review has lasted for more than a year now. I believe I had addressed or answered all questions and concerns. Thank all reviewers' precious feedbacks. For late comers, again (1) Original llvm-dev [RFC] discuss

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-04-08 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 336033. tentzen added a comment. fixed command option typos in two test cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 Files: clang/include/clang/AST/Stmt.h

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-04-07 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 336011. tentzen marked an inline comment as done. tentzen added a comment. clang-format fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 Files: clang/include/cl

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-04-05 Thread Ten Tzen via Phabricator via cfe-commits
tentzen marked 13 inline comments as done. tentzen added a comment. hi, I believe I'd addressed all issues or concerns, and it's rebased to up-to-date source in new _main branch now. Does this look good to everyone? If I don't hear any objection in a couple of days, I will go ahead make this pa

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-04-03 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 335068. tentzen added a comment. rebase the patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 Files: clang/include/clang/AST/Stmt.h clang/include/clang/Basic/La

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-04-01 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 334855. tentzen added a comment. Removed some files (mostly for Part 2 of this feature) that were accidentally put in last revision. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llv

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-02-23 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 325966. tentzen added a comment. Herald added a subscriber: jfb. changed option name and a couple of minor changes per John McCall's comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://re

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-02-17 Thread Ten Tzen via Phabricator via cfe-commits
tentzen marked an inline comment as not done. tentzen added a comment. thank you for the thorough review again. My answer for each comment below: Comment at: clang/lib/CodeGen/CGCleanup.cpp:1341 + llvm::FunctionCallee SehCppScope = + CGM.CreateRuntimeFunction(FTy, "llvm.

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2021-01-28 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Herald added a reviewer: jansvoboda11. Hi, John, sorry for the delay. I'm still in the middle of something. will context-switch a little bit latter. thanks, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-12-17 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Hi, Is there any more concerns, feedbacks or suggestions? thanks, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 ___ cfe-commits mailing

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-11-24 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#2410417 , @pengfei wrote: > In D80344#2407305 , @tentzen wrote: > >> In D80344#2407250 , @pengfei wrote: >> >>> Do we need to consider FP e

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-11-19 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#2407309 , @belliash wrote: > Does it really work for x86_64 architecture only? I have tried using this > with x86 build and produced binaries looks like this should work on this > platform as well, but I have not tried

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-11-19 Thread Ten Tzen via Phabricator via cfe-commits
tentzen marked 2 inline comments as done. tentzen added a comment. In D80344#2407250 , @pengfei wrote: > Do we need to consider FP exceptions in _try block? Yes, FP exception is handled as long as FP exceptions are not disabled (Ex via _controlfp() runti

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-11-19 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 306510. tentzen added a comment. Per Joseph's feedback, further clarify the semantic of llvm.seh.try.begin and llvm.seh.try.end. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.or

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-11-19 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added inline comments. Comment at: llvm/docs/LangRef.rst:11591 +and the EH cleanup is no longer required (e.g. because the destructor is being +called). + JosephTremoulet wrote: > Maybe add something here like > > > Any set of operations can then be conf

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-11-19 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 306469. tentzen added a comment. Fixed the clang fault when built without '-feh-asynch' option. EHStack's CGF field must be initialized even without -feh-asynch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-11-18 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 306287. tentzen added a comment. per review feedback from John McCall and others, this update includes: - Rename intrinsic eha.scope.begin() with seh.scope.begin(). - Update LangRef.rst with detailed explanation - Add conditional cleanup test case and move th

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-09-28 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. OK, great. Summarize our discussion above, I will follow up with: - rename intrinsic eha.scope.begin() with seh.scope.begin(). - update LangRef.rst with detailed explanation - not to allow inlining under SEH direct lexical scope - add conditional cleanup test case and m

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-09-24 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#2291926 , @rjmccall wrote: > Okay. I think we're on the same page about representation now. If you can > come up with a good replacement for "eha" in the intrinsic names, I think > this is pretty much ready to go. ho

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-09-24 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#2291688 , @rjmccall wrote: > In D80344#2291456 , @tentzen wrote: > >> Reordering is NOT okay for instructions 'directly' within a _try. 'directly' >> here means it's the code from

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-09-23 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#2291156 , @rjmccall wrote: > In D80344#2288898 , @tentzen wrote: > >> In D80344#2286838 , @rjmccall wrote: >> >>> In D80344#228

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-09-22 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D80344#2286838 , @rjmccall wrote: > In D80344#228 , @tentzen wrote: > >> Thank you for prompt reply again. >> >>> [rjmccall] And I agree with him that the potential benefits are >>>

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-09-21 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Thank you for prompt reply again. > [rjmccall] And I agree with him that the potential benefits are substantial. > I'm just saying that one barely-trafficked RFC thread is not evidence of a > community consensus. OK, thanks. it's good to know you are also supportive i

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-09-17 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Hi, John, thank you for reviewing this patch and providing feedback. regarding your comments: 1, In the RFC thread early, Reid K (the major contributor of Windows SEH/EH support) had agreed that "the value proposition is clear and large". 2, could you elaborate why do

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-07-12 Thread Ten Tzen via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG66f1dcd872db: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally (authored by tentzen). Changed prior to commit: https://reviews.llvm.org/D77982?vs=257227&id=277279#toc Repository:

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-06-11 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. this patch has lasted for a couple of months. a bug in this area is hard and time-consuming to diagnose. it's better to get this fix in sooner than later. could someone review and approve it? thanks, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-06-11 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. does it look good to you? or any more comment? thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 ___ cfe-commits mailing list cfe

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-06-04 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 268375. tentzen marked an inline comment as done. tentzen edited the summary of this revision. tentzen added a comment. update a couple of changes per David Majnemer's suggestion. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-06-03 Thread Ten Tzen via Phabricator via cfe-commits
tentzen marked 3 inline comments as done. tentzen added a comment. thank you David. will update and submit a new patch shortly. Comment at: clang/lib/CodeGen/CGException.cpp:603-609 + // For IsEHa catch(...) must handle HW exception + // Adjective = HT_IsStdDotDot (0

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-06-02 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Is there any feedback? thanks, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-06-02 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Hi, does this look good? or is there any other concern? thanks, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77982/new/ https://reviews.llvm.org/D77982 ___ cfe-commits mailing

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-05-26 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 266374. tentzen added a comment. update LangRef.rst for new intrinsics Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 Files: clang/include/clang/AST/Stmt.h clang/i

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-05-22 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 265819. tentzen removed a reviewer: lebedev.ri. tentzen added a comment. fixed tidy warnings Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 Files: clang/include/clan

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-05-22 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. > It may be helpful (even for the reviewers) to first specify their behavior, > instead of writing that after-the-fact "backwardly" based on the > implementation. For reviewers, the purpose of those intrinsic are described in Summary section: - Two intrinsic are create

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1

2020-05-22 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 265812. tentzen retitled this revision from "[Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC option -EHa)" to "[Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC -EHa) - Part 1". tentzen edited the summary of this revision. tentzen added a reviewer: lebedev.ri

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC option -EHa)

2020-05-22 Thread Ten Tzen via Phabricator via cfe-commits
tentzen marked 3 inline comments as done. tentzen added a comment. In D80344#2051127 , @lebedev.ri wrote: > This should likely be at least 3 patches: llvm middle-end, llvm codegen, > clang. > Langref changes missing for new intrinsics. > Please post all

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC option -EHa)

2020-05-22 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 265672. tentzen added a comment. avoid lint warnings and lint hang on Windows Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 Files: clang/include/clang/AST/Stmt.h

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC option -EHa)

2020-05-21 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 265442. tentzen added a comment. fixed formats Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80344/new/ https://reviews.llvm.org/D80344 Files: clang/include/clang/AST/Stmt.h clang/include/clang/Basic/LangO

[PATCH] D80344: [Windows SEH]: HARDWARE EXCEPTION HANDLING (MSVC option -EHa)

2020-05-20 Thread Ten Tzen via Phabricator via cfe-commits
tentzen created this revision. tentzen added reviewers: andrew.w.kaylor, rnk, majnemer, pengfei, eli.friedman, JosephTremoulet, asmith. Herald added subscribers: llvm-commits, cfe-commits, jdoerfert, kbarton, hiraditya, kristof.beyls, nemanjai. Herald added projects: clang, LLVM. This patch adds

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-05-13 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. Hi, Is there more concern? To re-iterate the implementation strategy of this change: This is a rare case that only manifests itself under Windows SEH. We don't want to pollut target agnostic codes. The ABI of SEH _finally is fixed with two implicit parameters; one ab

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-05-01 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a reviewer: asl. tentzen added a comment. Hi, Anton, I found you are the Code Owner of "Exception handling, Windows CodeGen, ARM EABI". could you please provide a quick review here? thanks, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-28 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. any more concern or comment? thanks, Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77982/new/ https://reviews.llvm.org/D77982 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-16 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 257977. tentzen added a comment. remade a patch after re-sync Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77936/new/ https://reviews.llvm.org/D77936 Files: clang/lib/CodeGen/CGCleanup.cpp clang/lib/CodeG

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-15 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. It can be greater than 2 because this Map includes Decls of User locals from parent. see CodeGenFunction::EmitCapturedLocals() (the same place of this fix). .. auto I = ParentCGF.LocalDeclMap.find(VD); if (I == ParentCGF.LocalDeclMap.end()) continue; Add

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-15 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 257849. tentzen added a comment. Replace F_HasSehAbnormalExits with F_HasExitSwitch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77936/new/ https://reviews.llvm.org/D77936 Files: clang/lib/CodeGen/CGCleanup

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-15 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. The fix there deals with SEH filter with SEH _finally parent where its prototype is FIXED (2 implicit parameters). It will never change. For #2, "...I was thinking you would save the ImplicitParmDecl*, not the actual alloca". If we just savw ImplicitParmDecl, we wil

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-14 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D77982#1981505 , @efriedma wrote: > Searching LocalDeclMap is less problematic, I guess... but still, it should > be possible to something more straightforward. Maybe make > startOutlinedSEHHelper store the actual ImplicitPar

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-14 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 257227. tentzen added a comment. Do not use name comparison to locate parent's alloca of frame-pointer-addr. search parent's LocalDeclMap instead. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77982/new/ https

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-14 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D77982#1978105 , @efriedma wrote: > Again, using the name isn't reliable. Among other things, in release builds, > IR values don't have names at all. ok, will fix it. Repository: rG LLVM Github Monorepo CHANGES SINCE LA

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-13 Thread Ten Tzen via Phabricator via cfe-commits
tentzen marked 2 inline comments as done. tentzen added inline comments. Comment at: clang/lib/CodeGen/CGCleanup.cpp:848 // Build a switch-out if we need it: // - if there are branch-afters threaded through the scope rnk wrote: > Are we sure thi

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-13 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 256942. tentzen added a comment. Remove hard-code name "frame-pointer". get the name from 2nd Arg of the _finally(). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77982/new/ https://reviews.llvm.org/D77982 Fi

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-13 Thread Ten Tzen via Phabricator via cfe-commits
tentzen marked 4 inline comments as done. tentzen added inline comments. Comment at: clang/lib/CodeGen/CGException.cpp:1798 + +// if the parent is a _finally, need to retrive Establisher's FP, +// 2nd paramenter, saved & named frame_pointer in parent's frame

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-12 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D77936#1976984 , @efriedma wrote: > I'm not concerned about the performance implications of whatever approach we > take here. In the worst case, an "icmp+zext" corresponds to two extra > arithmetic instructions; that's not en

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-12 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 256906. tentzen added a comment. Per Eli's suggestion, Use icmp (and zext) to check the JumpDest index, instead of directly passing the Index to _finally(). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77936/n

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-12 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 256896. tentzen added a comment. Fixed the format at comment lines Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77982/new/ https://reviews.llvm.org/D77982 Files: clang/lib/CodeGen/CGException.cpp clang/li

[PATCH] D77982: [Windows SEH] Fix the frame-ptr of a nested-filter within a _finally

2020-04-12 Thread Ten Tzen via Phabricator via cfe-commits
tentzen created this revision. tentzen added reviewers: rnk, eli.friedman, JosephTremoulet, asmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. This change fixed a SEH bug (exposed by test58 & test61 in MSVC test xcpt4u.c); when an Except-filter is located inside a final

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-12 Thread Ten Tzen via Phabricator via cfe-commits
tentzen added a comment. In D77936#1976938 , @efriedma wrote: > Instead of asserting there are less than 256 cleanup destinations, can you > emit an icmp against zero, or something like that? I did consider that. but it splits the block and induces one

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-12 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 256840. tentzen marked an inline comment as done. tentzen added a comment. Add option -fms-extensions in test case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77936/new/ https://reviews.llvm.org/D77936 File

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-11 Thread Ten Tzen via Phabricator via cfe-commits
tentzen updated this revision to Diff 256836. tentzen marked an inline comment as done. tentzen added a comment. Per Eli's feedbacks: (1) a test case (windows-seh-abnormal-exit.c) is added under clang\test\CodeGen directory. (2) an assert is added to catch the extremely rare case that the numbe

[PATCH] D77936: [Windows SEH] Fix abnormal-exits in _try

2020-04-11 Thread Ten Tzen via Phabricator via cfe-commits
tentzen created this revision. tentzen added reviewers: rnk, eli.friedman, JosephTremoulet, asmith. Herald added a project: clang. Herald added a subscriber: cfe-commits. Per Windows SEH Spec, except _leave, all other early exits of a _try (goto/return/continue/break) are considered abnormal exit