Page MenuHomePhabricator
Feed Advanced Search

Today

mstorsjo added inline comments to D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed.
Mon, Nov 23, 7:42 AM · Restricted Project
mstorsjo added a comment to D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed.

lgtm

(I added a naming comment, but feel free to resolve that as you feel is best.)

Mon, Nov 23, 7:28 AM · Restricted Project
mstorsjo added a comment to D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed.

Awesome, thanks! Do you want to have a look at the patch itself and review it, or does @rnk have time? (It's his original suggestion, to emit xdata in .seh_endproc, but the implementation is entirely trivial.)

@rnk knows this stuff much better than I do. Let's see if he has time, otherwise I can try to ramp up on it.

Mon, Nov 23, 5:19 AM · Restricted Project

Sat, Nov 21

mstorsjo committed rG33fb9679ec6e: [compiler-rt] [profile] Silence a warning about an unused function on mingw… (authored by mstorsjo).
[compiler-rt] [profile] Silence a warning about an unused function on mingw…
Sat, Nov 21, 12:15 PM
mstorsjo closed D91850: [compiler-rt] [profile] Silence a warning about an unused function on mingw targets.
Sat, Nov 21, 12:15 PM · Restricted Project
mstorsjo added a reviewer for D91181: [24/N] [libcxx] Make generic_*string return paths with forward slashes on windows: EricWF.
Sat, Nov 21, 6:24 AM · Restricted Project
mstorsjo added a reviewer for D91179: [23/N] [libcxx] Have lexically_normal return the path with preferred separators: EricWF.
Sat, Nov 21, 6:23 AM · Restricted Project
mstorsjo added a reviewer for D91178: [22/N] [libcxx] Implement append and operator/ properly for windows: EricWF.
Sat, Nov 21, 6:23 AM · Restricted Project
mstorsjo added a reviewer for D91177: [21/N] [libcxx] Implement is_absolute properly for windows: EricWF.
Sat, Nov 21, 6:22 AM · Restricted Project
mstorsjo added a reviewer for D91176: [20/N] [libcxx] Implement parsing of root_name for paths on windows: EricWF.
Sat, Nov 21, 6:22 AM · Restricted Project
mstorsjo added a reviewer for D91175: [19/N] [libcxx] Fix the fallback case in temp_directory_path for windows: EricWF.
Sat, Nov 21, 6:22 AM · Restricted Project
mstorsjo added a reviewer for D91173: [18/N] [libcxx] Use the posix code for directory_entry::__do_refresh: EricWF.
Sat, Nov 21, 6:22 AM · Restricted Project
mstorsjo added a reviewer for D91172: [17/N] [libcxx] Implement the read_symlink function for windows: EricWF.
Sat, Nov 21, 6:21 AM · Restricted Project
mstorsjo added a reviewer for D91171: [16/N] [libcxx] Implement the permissions function for windows: EricWF.
Sat, Nov 21, 6:21 AM · Restricted Project
mstorsjo added a reviewer for D91170: [15/N] [libcxx] Implement the canonical function for windows: EricWF.
Sat, Nov 21, 6:20 AM · Restricted Project
mstorsjo added a reviewer for D91169: [14/N] [libcxx] Implement the current_path function for windows: EricWF.
Sat, Nov 21, 6:20 AM · Restricted Project
mstorsjo added a reviewer for D91168: [13/N] [libcxx] Implement the space function for windows: EricWF.
Sat, Nov 21, 6:20 AM · Restricted Project
mstorsjo added a reviewer for D91143: [11/N] [libcxx] Hook up a number of operation functions to their windows counterparts: EricWF.
Sat, Nov 21, 6:19 AM · Restricted Project
mstorsjo added a reviewer for D91142: [10/N] [libcxx] Implement _FilesystemClock::now() and __last_write_time for windows: EricWF.
Sat, Nov 21, 6:19 AM · Restricted Project
mstorsjo added a reviewer for D91141: [9/N] [libcxx] Implement the stat function family on top of native windows APIs: EricWF.
Sat, Nov 21, 6:19 AM · Restricted Project
mstorsjo added a reviewer for D91140: [8/N] [libcxx] Fix the preexisting directory_iterator code for windows: EricWF.
Sat, Nov 21, 6:18 AM · Restricted Project
mstorsjo added a reviewer for D91139: [7/N] [libcxx] Don't use __int128 for msvc targets: EricWF.
Sat, Nov 21, 6:18 AM · Restricted Project
mstorsjo added a reviewer for D91138: [6/N] [libcxx] Handle backslash as path separator on windows: EricWF.
Sat, Nov 21, 6:18 AM · Restricted Project
mstorsjo added a reviewer for D91137: [5/N] [libcxx] Convert paths to/from the right narrow code page for narrow strings on windows: EricWF.
Sat, Nov 21, 6:17 AM · Restricted Project
mstorsjo added a reviewer for D91136: [4/N] [libcxx] Reorder the two u8path functions, to make the following diff more readable. NFC.: EricWF.
Sat, Nov 21, 6:17 AM · Restricted Project
mstorsjo added a reviewer for D91135: [3/N] [libcxx] Make filesystem::path::value_type wchar_t on windows: EricWF.
Sat, Nov 21, 6:17 AM · Restricted Project
mstorsjo added a reviewer for D91133: [2/N] [libcxx] [test] Add a test for conversions between wchar_t, utf8, char16_t, char32_t and windows native narrow code pages: EricWF.
Sat, Nov 21, 6:12 AM · Restricted Project
mstorsjo added a reviewer for D90222: [1/N] [libcxx] Implement c++2a char8_t input/output of std::filesystem::path: EricWF.
Sat, Nov 21, 5:13 AM · Restricted Project

Fri, Nov 20

mstorsjo added a comment to D91189: Add support for Intel's umonitor/umwait.

This broke compilation for me:

Which compiler/version are you using?

Fri, Nov 20, 11:58 AM · Restricted Project
mstorsjo requested review of D91853: [compiler-rt] [sanitizer] Silence -Wframe-larger-than= for a few windows functions with large stack buffers.
Fri, Nov 20, 1:45 AM · Restricted Project
mstorsjo requested review of D91852: [compiler-rt] [windows] Add UNUSED attributes on variables/functions only used for 64 bit targets.
Fri, Nov 20, 1:44 AM · Restricted Project
mstorsjo requested review of D91851: [compiler-rt] [emutls] Add ifdefs around msvc specific pragmas.
Fri, Nov 20, 1:41 AM · Restricted Project
mstorsjo requested review of D91850: [compiler-rt] [profile] Silence a warning about an unused function on mingw targets.
Fri, Nov 20, 1:39 AM · Restricted Project
mstorsjo added inline comments to D91142: [10/N] [libcxx] Implement _FilesystemClock::now() and __last_write_time for windows.
Fri, Nov 20, 12:05 AM · Restricted Project

Thu, Nov 19

mstorsjo added a comment to D91189: Add support for Intel's umonitor/umwait.

This broke compilation for me:

../runtime/src/kmp.h:1371:3: error: always_inline function '_umonitor' requires target feature 'waitpkg', but would be inlined into function '__kmp_umonitor' that is compiled without support for 'waitpkg'
  _umonitor(cacheline);
  ^ 
../runtime/src/kmp.h:1390:10: error: always_inline function '_umwait' requires target feature 'waitpkg', but would be inlined into function '__kmp_umwait' that is compiled without support for 'waitpkg'
  return _umwait(hint, counter);
         ^
2 errors generated.
Thu, Nov 19, 11:17 PM · Restricted Project

Wed, Nov 18

mstorsjo added inline comments to D91141: [9/N] [libcxx] Implement the stat function family on top of native windows APIs.
Wed, Nov 18, 1:15 PM · Restricted Project
mstorsjo added a comment to D91413: [libcxx] Provide __int128_t builtins needed for filesystem on MSVC.

I'd try to do some fix on the clang side. For example, don't define SIZEOF_INT128T when targeting windows triples (and don't have int128_t support in general), or make it a compile-time option, for people who want to link against compiler-rt vs those who don't, or make it not depend on compiler-rt but add the bit above as intrinsic when targeting windows.

Wed, Nov 18, 4:07 AM · Restricted Project
mstorsjo requested review of D91689: [LLD] [COFF] Allow wrapping dllimported functions.
Wed, Nov 18, 1:35 AM · Restricted Project
mstorsjo committed rG83a03867da12: [libcxx] Add missing _LIBCPP_FUNC_VIS on a few win32 locale functions (authored by mstorsjo).
[libcxx] Add missing _LIBCPP_FUNC_VIS on a few win32 locale functions
Wed, Nov 18, 1:06 AM
mstorsjo closed D91328: [libcxx] Add missing _LIBCPP_FUNC_VIS on a couple win32 locale functions.
Wed, Nov 18, 1:06 AM · Restricted Project

Tue, Nov 17

mstorsjo added a comment to D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed.
In D87448#2400337, @rnk wrote:

I would like to understand why LLD ICF time is sensitive to section ordering. I took the time to get set up to measure the difference in performance, but didn't find the time to investigate. I've had several personal and non-technical work things come up over the last week, so I probably don't have time to take this on.

Tue, Nov 17, 9:58 AM · Restricted Project
mstorsjo added inline comments to D89518: [windows-itanium] Add Windows Itanium How-To Guide.
Tue, Nov 17, 4:37 AM · Restricted Project
mstorsjo added inline comments to D91137: [5/N] [libcxx] Convert paths to/from the right narrow code page for narrow strings on windows.
Tue, Nov 17, 12:05 AM · Restricted Project

Mon, Nov 16

mstorsjo added inline comments to D91137: [5/N] [libcxx] Convert paths to/from the right narrow code page for narrow strings on windows.
Mon, Nov 16, 2:52 PM · Restricted Project
mstorsjo added a comment to D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed.

@hans - Can you check whether this works fine with libfuzzer and LLD's ICF?

Yes, this appears to fix the problem we saw. (I tried on Chromium's base_unittests.exe, where ICF time dropped from 13 s with the bad patch to 73 ms with this patch.) Thanks!

Mon, Nov 16, 1:31 PM · Restricted Project
mstorsjo reopened D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed.
Mon, Nov 16, 4:17 AM · Restricted Project
mstorsjo updated the diff for D87448: [CodeGen] [WinException] Only produce handler data at the end of the function if needed.

Updated for a retry, trying to retain the exact section ordering as before, to hopefully avoid the LLD ICF runtime explosion reported before.

Mon, Nov 16, 4:11 AM · Restricted Project
mstorsjo requested review of D91529: [llvm-readobj] [ARMWinEH] Clearly print an invalid case of packed unwind info as such.
Mon, Nov 16, 3:55 AM · Restricted Project

Sun, Nov 15

mstorsjo committed rG9bcef58b6377: [OpenMP] Fix building for windows after adding omp_calloc (authored by mstorsjo).
[OpenMP] Fix building for windows after adding omp_calloc
Sun, Nov 15, 11:33 AM
mstorsjo closed D91478: [OpenMP] Fix building for windows after adding omp_calloc.
Sun, Nov 15, 11:33 AM · Restricted Project

Fri, Nov 13

mstorsjo requested review of D91478: [OpenMP] Fix building for windows after adding omp_calloc.
Fri, Nov 13, 11:43 PM · Restricted Project
mstorsjo added a comment to D90554: [CostModel] remove cost-kind predicate for intrinsics in basic TTI implementation.

Thanks for the test. The difference with @main is in the unroller:
COMPLETELY UNROLLING loop %do.body6 with trip count 11!

And with that, it seems to vanish. Interestingly, the optimization was only happening with -O3 (not -O2) even before this patch because we set the unroll threshold higher at -O3.
I will try to reduce the example and adjust the cost model to make that work again.

Fri, Nov 13, 12:04 PM · Restricted Project
mstorsjo added a comment to D91413: [libcxx] Provide __int128_t builtins needed for filesystem on MSVC.

Since int128_t creates compiler_rt calls, it'd seem reasonable if we made uint128_t error out when targeting windows in the compiler

Fri, Nov 13, 8:38 AM · Restricted Project
mstorsjo added a comment to D90554: [CostModel] remove cost-kind predicate for intrinsics in basic TTI implementation.

I noticed a change in behaviour due to this commit - on ARM and AArch64, for cases involving the log2 intrinsic - previously, llvm was able to evaluate a big pile of code to deduce that a comparison involving log2 always is true, but after this change, it no longer does that. Is that something you want to have a look into, or is that expected? I wouldn't classify it as a bug in itself, as the code does what it's supposed to, it just optimizes differently than before.

If you can reduce a test that shows the difference, that would be great. I'm not sure which pass was responsible for the optimization.
My first guess is that we should create a basic class size-cost exception for all of the scalar intrinsics that correspond to libm functions.

Fri, Nov 13, 5:14 AM · Restricted Project
mstorsjo added a comment to D91139: [7/N] [libcxx] Don't use __int128 for msvc targets.

I guess the alternative is to lift implementations of __divti3 and __udivti3 from compiler-rt and place in libcxx/src/filesystem - there's already a copy of __muloti4 there, due to libgcc missing it, and we could provide those other two as well, for msvc builds.

Fri, Nov 13, 4:32 AM · Restricted Project
mstorsjo requested review of D91413: [libcxx] Provide __int128_t builtins needed for filesystem on MSVC.
Fri, Nov 13, 4:32 AM · Restricted Project
mstorsjo added a reviewer for D91177: [21/N] [libcxx] Implement is_absolute properly for windows: amccarth.
Fri, Nov 13, 3:51 AM · Restricted Project
mstorsjo added a reviewer for D91173: [18/N] [libcxx] Use the posix code for directory_entry::__do_refresh: amccarth.
Fri, Nov 13, 3:51 AM · Restricted Project
mstorsjo added a reviewer for D91175: [19/N] [libcxx] Fix the fallback case in temp_directory_path for windows: amccarth.
Fri, Nov 13, 3:51 AM · Restricted Project
mstorsjo added a reviewer for D91181: [24/N] [libcxx] Make generic_*string return paths with forward slashes on windows: amccarth.
Fri, Nov 13, 3:51 AM · Restricted Project
mstorsjo added a reviewer for D91179: [23/N] [libcxx] Have lexically_normal return the path with preferred separators: amccarth.
Fri, Nov 13, 3:50 AM · Restricted Project
mstorsjo added a reviewer for D91139: [7/N] [libcxx] Don't use __int128 for msvc targets: amccarth.
Fri, Nov 13, 3:50 AM · Restricted Project
mstorsjo updated the summary of D91178: [22/N] [libcxx] Implement append and operator/ properly for windows.
Fri, Nov 13, 3:50 AM · Restricted Project
mstorsjo added a reviewer for D91176: [20/N] [libcxx] Implement parsing of root_name for paths on windows: amccarth.
Fri, Nov 13, 3:49 AM · Restricted Project
mstorsjo added a reviewer for D91169: [14/N] [libcxx] Implement the current_path function for windows: amccarth.
Fri, Nov 13, 3:49 AM · Restricted Project
mstorsjo added a reviewer for D91138: [6/N] [libcxx] Handle backslash as path separator on windows: amccarth.
Fri, Nov 13, 3:48 AM · Restricted Project
mstorsjo added a reviewer for D91135: [3/N] [libcxx] Make filesystem::path::value_type wchar_t on windows: amccarth.
Fri, Nov 13, 3:48 AM · Restricted Project
mstorsjo added a reviewer for D91133: [2/N] [libcxx] [test] Add a test for conversions between wchar_t, utf8, char16_t, char32_t and windows native narrow code pages: amccarth.
Fri, Nov 13, 3:48 AM · Restricted Project
mstorsjo updated the diff for D91172: [17/N] [libcxx] Implement the read_symlink function for windows.

Rebased on top of updated patches.

Fri, Nov 13, 3:47 AM · Restricted Project
mstorsjo updated the diff for D91171: [16/N] [libcxx] Implement the permissions function for windows.

Rebased on top of updated patches.

Fri, Nov 13, 3:46 AM · Restricted Project
mstorsjo updated the diff for D91170: [15/N] [libcxx] Implement the canonical function for windows.

Rebased on top of updated patches.

Fri, Nov 13, 3:45 AM · Restricted Project
mstorsjo updated the diff for D91168: [13/N] [libcxx] Implement the space function for windows.

Rebased on top of updated patches.

Fri, Nov 13, 3:44 AM · Restricted Project
mstorsjo updated the diff for D91143: [11/N] [libcxx] Hook up a number of operation functions to their windows counterparts.

Made symlink_file_dir pass the inspected error code to set_errno(), passing O_BINARY to the open() function, passing the MOVEFILE_WRITE_THROUGH flag to MoveFileExW.

Fri, Nov 13, 3:43 AM · Restricted Project
mstorsjo updated the diff for D91142: [10/N] [libcxx] Implement _FilesystemClock::now() and __last_write_time for windows.

Rebased, taking changes in the preceding patches into account.

Fri, Nov 13, 3:41 AM · Restricted Project
mstorsjo updated the diff for D91141: [9/N] [libcxx] Implement the stat function family on top of native windows APIs.

Made the set_errno() helper take the error code as a parameter, to avoid double calls to GetLastError() if the caller already has fetched and inspected the error code.

Fri, Nov 13, 3:40 AM · Restricted Project
mstorsjo updated the diff for D91140: [8/N] [libcxx] Fix the preexisting directory_iterator code for windows.

Fixed the file size calculation by casting to uint64_t (and doing shifting instead of multiplying by MAXDWORD+1), moved the error mapping table to operations.cpp, removed inclusions of windows.h in the filesystem_common.h header.

Fri, Nov 13, 3:38 AM · Restricted Project
mstorsjo added a reviewer for D91137: [5/N] [libcxx] Convert paths to/from the right narrow code page for narrow strings on windows: amccarth.
Fri, Nov 13, 3:34 AM · Restricted Project
mstorsjo updated the diff for D91137: [5/N] [libcxx] Convert paths to/from the right narrow code page for narrow strings on windows.

Updated to define WIN32_LEAN_AND_MEAN and NOMINMAX when including windows.h in operations.cpp.

Fri, Nov 13, 3:33 AM · Restricted Project
mstorsjo added inline comments to D91140: [8/N] [libcxx] Fix the preexisting directory_iterator code for windows.
Fri, Nov 13, 3:31 AM · Restricted Project
mstorsjo added inline comments to D91143: [11/N] [libcxx] Hook up a number of operation functions to their windows counterparts.
Fri, Nov 13, 3:29 AM · Restricted Project
mstorsjo added a comment to D90554: [CostModel] remove cost-kind predicate for intrinsics in basic TTI implementation.

Thanks, all!
It's almost inevitable that some target will regress on some intrinsic with this change, so I'll be watching for fallout.

Fri, Nov 13, 2:18 AM · Restricted Project

Thu, Nov 12

mstorsjo added a comment to D91140: [8/N] [libcxx] Fix the preexisting directory_iterator code for windows.

Thanks for having a look!

Thu, Nov 12, 2:26 PM · Restricted Project
mstorsjo added inline comments to D91143: [11/N] [libcxx] Hook up a number of operation functions to their windows counterparts.
Thu, Nov 12, 2:20 PM · Restricted Project
mstorsjo requested review of D91334: [compiler-rt] Set CMAKE_TRY_COMPILE_TARGET_TYPE to STATIC_LIBRARY when building builtins standalone.
Thu, Nov 12, 4:14 AM · Restricted Project
mstorsjo requested review of D91328: [libcxx] Add missing _LIBCPP_FUNC_VIS on a couple win32 locale functions.
Thu, Nov 12, 1:00 AM · Restricted Project

Wed, Nov 11

mstorsjo added inline comments to D89518: [windows-itanium] Add Windows Itanium How-To Guide.
Wed, Nov 11, 2:07 PM · Restricted Project

Tue, Nov 10

mstorsjo added a reviewer for D91141: [9/N] [libcxx] Implement the stat function family on top of native windows APIs: amccarth.
Tue, Nov 10, 1:38 PM · Restricted Project
mstorsjo added a reviewer for D91142: [10/N] [libcxx] Implement _FilesystemClock::now() and __last_write_time for windows: amccarth.
Tue, Nov 10, 1:37 PM · Restricted Project
mstorsjo added a reviewer for D91145: [12/N] [libcxx] Sanitize paths before creating symlinks on windows: amccarth.
Tue, Nov 10, 1:37 PM · Restricted Project
mstorsjo added a reviewer for D91143: [11/N] [libcxx] Hook up a number of operation functions to their windows counterparts: amccarth.
Tue, Nov 10, 1:37 PM · Restricted Project
mstorsjo added a reviewer for D91140: [8/N] [libcxx] Fix the preexisting directory_iterator code for windows: amccarth.
Tue, Nov 10, 1:37 PM · Restricted Project
mstorsjo added a comment to D91139: [7/N] [libcxx] Don't use __int128 for msvc targets.

I guess the alternative is to lift implementations of __divti3 and __udivti3 from compiler-rt and place in libcxx/src/filesystem - there's already a copy of __muloti4 there, due to libgcc missing it, and we could provide those other two as well, for msvc builds.

Tue, Nov 10, 1:36 PM · Restricted Project
mstorsjo updated subscribers of D91140: [8/N] [libcxx] Fix the preexisting directory_iterator code for windows.
In D91140#2386807, @rnk wrote:

Hi, I'm pretty busy right now, and I'm falling behind on other code reviews. Can you send this libc++ patch series to @amccarth? He's on my team, and is familiar with the Win32 API, but is unfamiliar with mingw conventions. Hopefully he has enough experience to help implement these parts of the standard library.

Tue, Nov 10, 1:11 PM · Restricted Project
mstorsjo added inline comments to D91175: [19/N] [libcxx] Fix the fallback case in temp_directory_path for windows.
Tue, Nov 10, 10:57 AM · Restricted Project
mstorsjo added a comment to D91172: [17/N] [libcxx] Implement the read_symlink function for windows.

FWIW, after this patch, it should compile successfully for windows, the later patches only fix remaining behaviours.

Tue, Nov 10, 9:02 AM · Restricted Project
mstorsjo updated subscribers of D91139: [7/N] [libcxx] Don't use __int128 for msvc targets.

This influences the ABI IIRC, so this choice may be forever.

Tue, Nov 10, 8:58 AM · Restricted Project
mstorsjo requested review of D91181: [24/N] [libcxx] Make generic_*string return paths with forward slashes on windows.
Tue, Nov 10, 8:56 AM · Restricted Project
mstorsjo requested review of D91179: [23/N] [libcxx] Have lexically_normal return the path with preferred separators.
Tue, Nov 10, 8:48 AM · Restricted Project
mstorsjo requested review of D91178: [22/N] [libcxx] Implement append and operator/ properly for windows.
Tue, Nov 10, 8:47 AM · Restricted Project
mstorsjo requested review of D91177: [21/N] [libcxx] Implement is_absolute properly for windows.
Tue, Nov 10, 8:45 AM · Restricted Project