weimingz (Weiming Zhao)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 19 2012, 2:50 AM (260 w, 5 d)

Recent Activity

Thu, Nov 9

weimingz committed rL317814: [Builtins] Do not use tailcall for Thumb1.
[Builtins] Do not use tailcall for Thumb1
Thu, Nov 9, 9:33 AM
weimingz closed D39700: [Builtins] Do not use tailcall for Thumb1 by committing rL317814: [Builtins] Do not use tailcall for Thumb1.
Thu, Nov 9, 9:33 AM

Tue, Nov 7

weimingz added a comment to D39700: [Builtins] Do not use tailcall for Thumb1.

If compiler-rt is to provide optimized version, then, should MUSL just forwards the calls like memcpy ->__aeabi_memcpy ? Because libc is usually appear first in linking order, a standard implementation in libc will hide the optimized version in compiler-rt.

Tue, Nov 7, 2:25 PM
weimingz added a comment to D39700: [Builtins] Do not use tailcall for Thumb1.

I agree that we must avoid the 16-bit branch on Thumb1 and that the code sequence is fine for that purpose.

I do wonder if compiler-rt should define the aeabi_... forwarding functions in it? I would have expected the C-library to define them. For example the v6-m libgcc.a does not define the aeabi memcpy family, the forwarding is done in newlib. Similarly Arm's proprietary compiler's C library defines aeabi_memcpy that just falls through directly into memcpy. I'm guessing that there is some C-library that we support that does not define the aeabi_ function?

Tue, Nov 7, 9:46 AM

Mon, Nov 6

weimingz updated the diff for D39700: [Builtins] Do not use tailcall for Thumb1.

add memcpy

Mon, Nov 6, 2:36 PM
weimingz created D39700: [Builtins] Do not use tailcall for Thumb1.
Mon, Nov 6, 2:27 PM
weimingz added a comment to D39600: [docs][ARM] Add HowTo for cross compiling and testing compiler-rt builtins on Arm.

Should we use "ARM" instead of "Arm" ?

Mon, Nov 6, 12:17 PM

Sep 26 2017

weimingz added a comment to D38268: [Builtins] ARM: Fix msr assembly instruction use for Thumb2..

LGTM. (Let Saleem to sign off)

Sep 26 2017, 4:02 PM
weimingz added a comment to D38227: [Builtins] ARM: Fix assembling files in thumb mode..

LGTM.

Sep 26 2017, 3:54 PM

Sep 19 2017

weimingz committed rL313694: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.
[libc++] Replace __sync_* functions with __libcpp_atomic_* functions
Sep 19 2017, 4:19 PM
weimingz closed D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions by committing rL313694: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.
Sep 19 2017, 4:19 PM
weimingz updated the diff for D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.

minor change

Sep 19 2017, 4:09 PM
weimingz updated the diff for D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.

Moved the inclusion from stdexcept.cpp into refstring.h

Sep 19 2017, 1:36 PM

Sep 6 2017

weimingz added a reviewer for D31139: [LLVMbugs] [Bug 18710] Only generate .ARM.exidx and .ARM.extab when needed with EHABI: eli.friedman.
Sep 6 2017, 9:24 AM

Aug 30 2017

weimingz added a reviewer for D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions: eli.friedman.
Aug 30 2017, 9:28 AM

Aug 22 2017

weimingz added inline comments to D36555: Move x86-specific sources to x86-specific source lists..
Aug 22 2017, 3:59 PM
weimingz added reviewers for D36555: Move x86-specific sources to x86-specific source lists.: rengolin, compnerd.

LGTM. Adding Renato and Saleem to approve.

Aug 22 2017, 3:59 PM

Aug 15 2017

weimingz updated the diff for D36762: [Builtins][ARM] Force ARM state for bswap for pre-ARMv6.

guard the "DEFINE_CODE_STATE" with "__ARM_ARCH < 6" check.

Aug 15 2017, 12:57 PM
weimingz created D36762: [Builtins][ARM] Force ARM state for bswap for pre-ARMv6.
Aug 15 2017, 11:45 AM

Aug 14 2017

weimingz committed rL310890: [builtins] fix build error on non-ARM for r310884.
[builtins] fix build error on non-ARM for r310884
Aug 14 2017, 2:45 PM
weimingz added a comment to D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.

ping @EricWF

Aug 14 2017, 1:59 PM
weimingz committed rL310884: [builtins][ARM] Select correct code fragments when compiling for….
[builtins][ARM] Select correct code fragments when compiling for…
Aug 14 2017, 1:49 PM
weimingz closed D31220: [builtins][ARM] Select correct code fragments when compiling for Thumb1/Thum2/ARM ISA by committing rL310884: [builtins][ARM] Select correct code fragments when compiling for….
Aug 14 2017, 1:49 PM
weimingz updated the diff for D31220: [builtins][ARM] Select correct code fragments when compiling for Thumb1/Thum2/ARM ISA.

remove unreleated change (CMakefile) and address comments from Saleem

Aug 14 2017, 1:48 PM
weimingz added a comment to D35970: Teach cc1as driver to accept ARM ropi/rwpi reloc model.

I think it would be better to reject these options than to silently accept them, unless you plan on using them to emit build attributes.

Aug 14 2017, 1:29 PM

Aug 11 2017

weimingz added a comment to D35970: Teach cc1as driver to accept ARM ropi/rwpi reloc model.

ping?

Aug 11 2017, 10:42 AM

Aug 7 2017

weimingz added a comment to D35970: Teach cc1as driver to accept ARM ropi/rwpi reloc model.

And since it's an assertion, in Release build, the flag will still be accepted silently.

Aug 7 2017, 5:53 PM
weimingz updated the diff for D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.

rebased. Please review. Thanks

Aug 7 2017, 11:51 AM

Aug 3 2017

weimingz added a reviewer for D36249: Mark tests that need intel 80-bit floats as x86-only: joerg.
Aug 3 2017, 11:51 AM
weimingz added a comment to D36249: Mark tests that need intel 80-bit floats as x86-only.

I tried to address it via checking pre-defined macros:
https://reviews.llvm.org/D31573

As long as the macros are defined correctly by clang, we don't need to worry about the specific target machine. How do you think about it?

I like the idea of a feature check, rather than a specific architecture check--that is clearly the right thing to do.

On the other hand, I would like to mark the test as unsupported and not run in that case, rather than running it, saying it passed, but not actually testing anything. That better reflects the state of the implementation. Unfortunately, I don't think that can be done with macro checks. So my preference would be this patch over D31573, but I would also find D31573 acceptable if it came to that.

Finally, 80-bit doubles are a bit of a historical artifact these days. Only x86 and m68k have them (and not even all m68Ks either). So I don't think it matters that much.

Aug 3 2017, 11:51 AM

Aug 2 2017

weimingz added a comment to D36249: Mark tests that need intel 80-bit floats as x86-only.

I tried to address it via checking pre-defined macros:
https://reviews.llvm.org/D31573

Aug 2 2017, 11:46 PM

Jul 31 2017

weimingz added a comment to D35970: Teach cc1as driver to accept ARM ropi/rwpi reloc model.

This looks like it'll get the build attributes wrong (since only PIC gets plumbed through to the backend). That's probably worse than simply rejecting the arguments.

Jul 31 2017, 4:02 PM
weimingz updated the diff for D35970: Teach cc1as driver to accept ARM ropi/rwpi reloc model.

add test case

Jul 31 2017, 3:05 PM

Jul 27 2017

weimingz created D35970: Teach cc1as driver to accept ARM ropi/rwpi reloc model.
Jul 27 2017, 6:04 PM

Jul 26 2017

weimingz added a comment to D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.

ping?

Jul 26 2017, 5:06 PM

Jul 18 2017

weimingz committed rL308404: Fix DebugLoc propagation for unreachable LoadInst.
Fix DebugLoc propagation for unreachable LoadInst
Jul 18 2017, 6:27 PM
weimingz closed D34639: Fix DebugLoc propagation for unreachable LoadInst by committing rL308404: Fix DebugLoc propagation for unreachable LoadInst.
Jul 18 2017, 6:27 PM

Jul 17 2017

weimingz updated the diff for D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.

rebased after reverting r307595 and moving __refstring header

Jul 17 2017, 6:10 PM

Jul 14 2017

weimingz updated the diff for D31220: [builtins][ARM] Select correct code fragments when compiling for Thumb1/Thum2/ARM ISA.

address the review comments by @peter.smith and @jamesduley

Jul 14 2017, 11:28 AM

Jul 13 2017

weimingz updated the diff for D31220: [builtins][ARM] Select correct code fragments when compiling for Thumb1/Thum2/ARM ISA.

rebased

Jul 13 2017, 11:18 AM

Jul 10 2017

weimingz created D35235: [libc++] Replace __sync_* functions with __libcpp_atomic_* functions.
Jul 10 2017, 6:32 PM
weimingz added a comment to D34918: [libc++] Refactoring __sync_* builtins; NFC.

I should use existing include/atomic_support.h. Will upload the patch shortly.

Jul 10 2017, 6:22 PM
weimingz updated the diff for D34639: Fix DebugLoc propagation for unreachable LoadInst.

simplify test case

Jul 10 2017, 5:34 PM
weimingz committed rL307595: [libc++] Refactoring __sync_* builtins; NFC (Reland).
[libc++] Refactoring __sync_* builtins; NFC (Reland)
Jul 10 2017, 2:38 PM
weimingz updated the diff for D34918: [libc++] Refactoring __sync_* builtins; NFC.

missed to upload the change to include __atomic_support header file

Jul 10 2017, 2:31 PM
weimingz committed rL307593: Revert "[libc++] Refactoring __sync_* builtins; NFC".
Revert "[libc++] Refactoring __sync_* builtins; NFC"
Jul 10 2017, 2:24 PM
weimingz committed rL307591: [libc++] Refactoring __sync_* builtins; NFC.
[libc++] Refactoring __sync_* builtins; NFC
Jul 10 2017, 2:03 PM
weimingz closed D34918: [libc++] Refactoring __sync_* builtins; NFC by committing rL307591: [libc++] Refactoring __sync_* builtins; NFC.
Jul 10 2017, 2:03 PM
weimingz retitled D34918: [libc++] Refactoring __sync_* builtins; NFC from [libc++] Avoid atomic built-ins for NO_THREADS build to [libc++] Refactoring __sync_* builtins; NFC.
Jul 10 2017, 1:41 PM

Jul 9 2017

weimingz added a comment to D34639: Fix DebugLoc propagation for unreachable LoadInst.

testcase?

Jul 9 2017, 6:13 AM

Jul 6 2017

weimingz updated the diff for D34918: [libc++] Refactoring __sync_* builtins; NFC.
Jul 6 2017, 5:31 PM
weimingz updated the diff for D34918: [libc++] Refactoring __sync_* builtins; NFC.

@EricWF , do you mean factoring out the __sync_* functions like this?

Jul 6 2017, 5:29 PM

Jul 5 2017

weimingz added a comment to D34918: [libc++] Refactoring __sync_* builtins; NFC.

How about we use "#ifdef GCC_ATOMIC_POINTER_LOCK_FREE < 2 && LIBCPP_HAS_NO_THREAD" ?
This can minimize the impact.

Jul 5 2017, 11:51 AM
weimingz added a comment to D34918: [libc++] Refactoring __sync_* builtins; NFC.

If the architecture doesn't support atomics (like cortex-m0), seems there is no software solution to make them signal-safe. Mutex/lock won't work.

Jul 5 2017, 11:37 AM
weimingz added a comment to D34918: [libc++] Refactoring __sync_* builtins; NFC.

On architectures without atomic instructions, the atomic built-ins cannot be lowered. If _LIBCPP_HAS_NO_THREADS is enabled, we should just use regular code.

Does "cannot be lowered" mean using them causes a compile error? If so I'm curious as to why you're the first one to run into this issue. If no compile error is caused then could you re-explain the rational for this change.

Lock-free atomic operations are also signal safe. Your code is not. While I don't know whether all this functions are not required to be signal safe, the general assertion is certainly questionable.

No, they are no signal safe. Per [1], "call to any library function, except the following signal-safe functions (note, in particular, dynamic allocation is not signal-safe):".

Locale.cpp should be fine with the change.
{set,get}_new_handler, {set,get}_unexpected_handler are not in the list.
I'm not very sure about "__libcpp_refstring". Seems it is only used by stdexcept. Although throw expression is explicitly stated as not signal safe, the ref counting of stdexcept might be. We can leave it unchanged.

It would be really nice if we didn't cause the user unnecessary pain. Just because these functions aren't *required* to be signal safe doesn't necessarily mean they shouldn't be.

If this patch is indeed needed I would like to see it done similar to how __libcpp_refcount_foo or the src/include/atomic_support.h logic is implemented, where instead of having #ifdef branches at each call site the logic has been abstracted away into a function.

That being said I would like to better understand the rational for this patch before proceeding.

Jul 5 2017, 11:34 AM

Jul 3 2017

weimingz added a comment to D34918: [libc++] Refactoring __sync_* builtins; NFC.

Lock-free atomic operations are also signal safe. Your code is not. While I don't know whether all this functions are not required to be signal safe, the general assertion is certainly questionable.

Jul 3 2017, 10:17 AM

Jun 30 2017

weimingz added a reviewer for D34918: [libc++] Refactoring __sync_* builtins; NFC: jroelofs.
Jun 30 2017, 4:40 PM
weimingz created D34918: [libc++] Refactoring __sync_* builtins; NFC.
Jun 30 2017, 4:36 PM

Jun 26 2017

weimingz updated the diff for D34639: Fix DebugLoc propagation for unreachable LoadInst.
Jun 26 2017, 11:45 PM
weimingz removed a reviewer for D34639: Fix DebugLoc propagation for unreachable LoadInst: llvm-commits.
Jun 26 2017, 12:42 PM
weimingz created D34639: Fix DebugLoc propagation for unreachable LoadInst.
Jun 26 2017, 12:41 PM

May 11 2017

weimingz added a comment to D30324: [ARM] Thumb2: favor R4-R7 over R12/LR in allocation order when opt for minsize.

ping?

May 11 2017, 11:11 AM

May 5 2017

weimingz committed rL302274: [ARM] Limit the diagnose when an ISR calls a regular function.
[ARM] Limit the diagnose when an ISR calls a regular function
May 5 2017, 12:38 PM
weimingz closed D32918: [ARM] Limit the diagnose when an ISR calls a regular function by committing rL302274: [ARM] Limit the diagnose when an ISR calls a regular function.
May 5 2017, 12:38 PM
weimingz created D32918: [ARM] Limit the diagnose when an ISR calls a regular function.
May 5 2017, 12:17 PM

Apr 20 2017

weimingz committed rL300870: [Thumb-1] Fix corner cases for compressed jump tables.
[Thumb-1] Fix corner cases for compressed jump tables
Apr 20 2017, 11:50 AM
weimingz closed D32250: [Thumb-1] Fix corner cases for compressed jump tables by committing rL300870: [Thumb-1] Fix corner cases for compressed jump tables.
Apr 20 2017, 11:50 AM
weimingz updated the summary of D32250: [Thumb-1] Fix corner cases for compressed jump tables.
Apr 20 2017, 11:45 AM
weimingz updated the diff for D32250: [Thumb-1] Fix corner cases for compressed jump tables.

Just find that one case was fixed by r297871 ARM: avoid clobbering register in v6 jump-table expansion.

Apr 20 2017, 11:44 AM

Apr 19 2017

weimingz updated the diff for D30324: [ARM] Thumb2: favor R4-R7 over R12/LR in allocation order when opt for minsize.

Below are the measurements of text size of benchmarks.
Build flag: "-Oz -mthumb -mcpu=cortex-m3 -fomit-frame-pointer"
Baseline has extra flag: " -mllvm -arm-favor-r4-r7=false"

Apr 19 2017, 11:03 PM
weimingz added a comment to D31573: [Builtins] Fix test cases for xf/ti.

ping?

Apr 19 2017, 3:30 PM
weimingz added a comment to D32250: [Thumb-1] Fix corner cases for compressed jump tables.

This fixes some SPEC2000 fails when build for Thumb1 with -Os.
I do not upload the lit test because it's not easy to reduce to a simple/clean one as it needs specific reg alloc to show the problem.

Apr 19 2017, 3:21 PM
weimingz updated the summary of D32250: [Thumb-1] Fix corner cases for compressed jump tables.
Apr 19 2017, 3:17 PM
weimingz created D32250: [Thumb-1] Fix corner cases for compressed jump tables.
Apr 19 2017, 3:08 PM

Apr 10 2017

weimingz added a comment to D31742: [Builtins] Fix lit test setup for Windows.

btw, should we use "--rtlib=compiler-rt" rather than passing the libname explicitly?

Apr 10 2017, 11:01 AM
weimingz added inline comments to rL299780: [builtins] Get the builtins tests passing on Windows.
Apr 10 2017, 5:35 AM

Apr 8 2017

weimingz updated the diff for D31742: [Builtins] Fix lit test setup for Windows.

Thanks for the info!

Apr 8 2017, 10:52 PM

Apr 6 2017

weimingz updated the diff for D31742: [Builtins] Fix lit test setup for Windows.

I tried to use the lib name from cmake/Module/AddCompilerRT.cmake : add_compiler_rt_runtime but no luck.
And I can't find where the suffix is set in compiler-rt project.

Apr 6 2017, 6:02 PM
weimingz added a reviewer for D31775: [ARM] Add Kryo to available targets: apazos.
Apr 6 2017, 2:15 PM
weimingz added a comment to D31742: [Builtins] Fix lit test setup for Windows.

Not sure if it is the portable way to do.
I see cmake/base-config-ix.cmake has set(CMAKE_STATIC_LIBRARY_SUFFIX_C ".lib"), but I can't find where the variable is used and not sure if we can use it in test/CMakefile.

Apr 6 2017, 12:08 AM
weimingz created D31742: [Builtins] Fix lit test setup for Windows.
Apr 6 2017, 12:04 AM

Apr 5 2017

weimingz added a comment to D31573: [Builtins] Fix test cases for xf/ti.

Thanks for the explanation. The current patch should address the problem, right?

Apr 5 2017, 11:38 PM
weimingz retitled D31573: [Builtins] Fix test cases for xf/ti from [Builtins] Add IEEE 754 support for __fixunsxfti to [Builtins] Fix test cases for xf/ti.
Apr 5 2017, 11:31 PM
weimingz committed rL299628: [Builtins] Fix div0 error in udivsi3.
[Builtins] Fix div0 error in udivsi3
Apr 5 2017, 11:26 PM
weimingz closed D31716: [Builtins] Fix div0 error in udivsi3 by committing rL299628: [Builtins] Fix div0 error in udivsi3.
Apr 5 2017, 11:26 PM
weimingz accepted D31721: Add __ffssi2 implementation to compiler-rt builtins.

LGTM.

Apr 5 2017, 1:47 PM
weimingz updated the diff for D31716: [Builtins] Fix div0 error in udivsi3.

move up the "divby0" block for the case with HW div to make the code easier to read.

Apr 5 2017, 12:29 PM
weimingz updated the diff for D31716: [Builtins] Fix div0 error in udivsi3.

I think the r7 (fp) was not set to initial SP, so it won't matter for stack-based unwinding. Anyway, use r7 now.

Apr 5 2017, 11:23 AM
weimingz added reviewers for D31716: [Builtins] Fix div0 error in udivsi3: rengolin, compnerd.
Apr 5 2017, 10:16 AM
weimingz created D31716: [Builtins] Fix div0 error in udivsi3.
Apr 5 2017, 10:11 AM

Apr 3 2017

weimingz updated the diff for D31573: [Builtins] Fix test cases for xf/ti.

these tests are the only 4 tests that use 128 bit long long.
Other tests that uses HAS_80_BIT_LONG_DOUBLE should be replaced with __LDBL_MANT_DIG__ == 64

Apr 3 2017, 4:21 PM
weimingz added a comment to D31573: [Builtins] Fix test cases for xf/ti.

In my view, LDBL_MANT_DIG == 64 implies HAS_80_BIT_LONG_DOUBLE, but need t to exclude MIPS as it clang BE doesn't support it.

Apr 3 2017, 3:55 PM
weimingz updated the diff for D31573: [Builtins] Fix test cases for xf/ti.

seems no way to detect if 80-bit ldbl is supported or not. Leave it to the build time flags.

Apr 3 2017, 3:49 PM
weimingz added inline comments to D31573: [Builtins] Fix test cases for xf/ti.
Apr 3 2017, 3:14 PM
weimingz committed rL299392: Reland r298901 with modifications (reverted in r298932).
Reland r298901 with modifications (reverted in r298932)
Apr 3 2017, 3:02 PM
weimingz closed D30724: Dont emit Mapping symbols for sections that contain only data. by committing rL299392: Reland r298901 with modifications (reverted in r298932).
Apr 3 2017, 3:02 PM
weimingz updated the diff for D31573: [Builtins] Fix test cases for xf/ti.

Change to HAS_80_BIT_LONG_DOUBLE just like other tests.
Also, if HAS_80_BIT_LONG_DOUBLE is not defined, we can set it if CRT_HAS_128BIT && LDBL_MANT_DIG == 64. So even if the build doesn't specify it, the test won't be skipped by mistake.

Apr 3 2017, 2:36 PM
weimingz added a comment to D31573: [Builtins] Fix test cases for xf/ti.

If the platform doesn't support it, the LDBL_MANT_DIG will be 53 (refer to clang/test/Preprocessor/init.c )

Apr 3 2017, 1:39 PM
weimingz updated the diff for D31573: [Builtins] Fix test cases for xf/ti.
Apr 3 2017, 12:32 PM
weimingz updated the diff for D31573: [Builtins] Fix test cases for xf/ti.

I guess HAS_80_BIT_LONG_DOUBLE is passed as some build-time flags. I can't find it anywhere in the compiler-rt source tree that defines it.

Apr 3 2017, 12:28 PM