Page MenuHomePhabricator

zhuhan0 (Han Zhu)
User

Projects

User does not belong to any projects.

User Details

User Since
Mar 9 2020, 11:40 AM (91 w, 1 d)

Recent Activity

Thu, Dec 2

zhuhan0 abandoned D108353: [loop-idiom] Support memcpy instructions for memmove-like loops.

https://reviews.llvm.org/D107075 landed.

Thu, Dec 2, 11:54 AM · Unknown Object (Project)

Oct 7 2021

zhuhan0 accepted D107075: [LoopIdiom] Transform loop containing memcpy into memmove.

LGTM.

Oct 7 2021, 9:34 AM · Unknown Object (Project)

Oct 4 2021

zhuhan0 added a comment to D107075: [LoopIdiom] Transform loop containing memcpy into memmove.

Sorry for the delay. I've been occupied with other projects.

Oct 4 2021, 11:46 AM · Unknown Object (Project)

Aug 20 2021

zhuhan0 added a comment to D108353: [loop-idiom] Support memcpy instructions for memmove-like loops.

@zhuhan0: Thanks for following up my memmove change! Actually there is analogous follow up but it didn't catch lot of attention: https://reviews.llvm.org/D107075.
Maybe you can reuse some parts of that change. I feel you could at least copy most unit tests from there for better coverage.
And last but not least - there is one ongoing small but important fix for https://reviews.llvm.org/D104464 which can be found here: https://reviews.llvm.org/D107964
It would be great if you and @hoy could take a look since your changes depends on it.

Aug 20 2021, 5:01 PM · Unknown Object (Project)

Aug 19 2021

zhuhan0 added a reviewer for D108353: [loop-idiom] Support memcpy instructions for memmove-like loops: efriedma.
Aug 19 2021, 12:28 AM · Unknown Object (Project)
zhuhan0 added reviewers for D108353: [loop-idiom] Support memcpy instructions for memmove-like loops: lebedev.ri, yurai007, xbolva00, zino, wenlei, hoy.
Aug 19 2021, 12:26 AM · Unknown Object (Project)
zhuhan0 requested review of D108353: [loop-idiom] Support memcpy instructions for memmove-like loops.
Aug 19 2021, 12:24 AM · Unknown Object (Project)

Aug 18 2021

zhuhan0 committed rG687f046c979a: [NFC][loop-idiom] Rename Stores to IgnoredInsts; Fix a typo (authored by zhuhan0).
[NFC][loop-idiom] Rename Stores to IgnoredInsts; Fix a typo
Aug 18 2021, 10:54 AM
zhuhan0 closed D108275: [NFC][loop-idiom] Rename Stores to IgnoredInsts; Fix a typo.
Aug 18 2021, 10:54 AM · Unknown Object (Project)
zhuhan0 updated the diff for D108275: [NFC][loop-idiom] Rename Stores to IgnoredInsts; Fix a typo.

Address comment.

Aug 18 2021, 10:41 AM · Unknown Object (Project)
zhuhan0 added reviewers for D108275: [NFC][loop-idiom] Rename Stores to IgnoredInsts; Fix a typo: lebedev.ri, yurai007, zino, wenlei, hoy.
Aug 18 2021, 12:10 AM · Unknown Object (Project)
zhuhan0 requested review of D108275: [NFC][loop-idiom] Rename Stores to IgnoredInsts; Fix a typo.
Aug 18 2021, 12:09 AM · Unknown Object (Project)

May 13 2021

zhuhan0 accepted D102116: [LoopIdiom] 'logical right-shift until zero' ('count active bits') "on steroids" idiom recognition..

LGTM.

May 13 2021, 1:02 PM · Unknown Object (Project)

May 12 2021

zhuhan0 added inline comments to D102116: [LoopIdiom] 'logical right-shift until zero' ('count active bits') "on steroids" idiom recognition..
May 12 2021, 12:22 PM · Unknown Object (Project)
zhuhan0 added inline comments to D102116: [LoopIdiom] 'logical right-shift until zero' ('count active bits') "on steroids" idiom recognition..
May 12 2021, 11:49 AM · Unknown Object (Project)

May 4 2021

zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Alright.
Please ensure that you have added all the necessary tests.
It looks about reasonable to me now, i think you can try re-landing it.

May 4 2021, 5:07 PM · Unknown Object (Project)
zhuhan0 committed rGda1cdffbb1b7: [loop-idiom] Hoist loop memcpys to loop preheader (authored by zhuhan0).
[loop-idiom] Hoist loop memcpys to loop preheader
May 4 2021, 5:07 PM
zhuhan0 closed D97667: [loop-idiom] Hoist loop memcpys to loop preheader.
May 4 2021, 5:07 PM · Unknown Object (Project)

May 3 2021

zhuhan0 added inline comments to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.
May 3 2021, 11:16 PM · Unknown Object (Project)

Apr 30 2021

zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

With this patch we got the following assertion:

bool llvm::APInt::operator==(const llvm::APInt &) const: Assertion `BitWidth == RHS.BitWidth && "Comparison requires equal bit widths"' failed.

in LoopIdiomRecognize::processLoopMemCpy() at the following comparison:

// Check if the load stride matches the store stride.
if (StrIntStride != LoadIntStride && StrIntStride != -LoadIntStride)
  return false;

for a memcpy done between two address spaces with different pointer sizes.

I don't have a upstream reproducer ready for this, but I'll see if I can create one.

Apr 30 2021, 4:51 PM · Unknown Object (Project)
zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Compare LoadStride and StoreStride after sign extension.

Apr 30 2021, 4:42 PM · Unknown Object (Project)
zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Describing what the code is intended to do (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/compiler/xla/tests/reverse_test.cc#L146).

A 4d array is taking in reversing elements across the 0th and 1st dimensions, so for every value previously indexed at [A,B,C,D] in an array of size [W,X,Y,Z], the new index of the value is [W-A-1, X-B-1, C, D].

The original code indexes into proper locations for the first 2 dimensions, and then copies the subdata, while this change results in a single copy after indexing only in dimension 0, which cannot be done as the data in dimension 1 cannot be copied due to the reversal.

Apr 30 2021, 3:26 PM · Unknown Object (Project)

Apr 28 2021

zhuhan0 added inline comments to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.
Apr 28 2021, 3:47 PM · Unknown Object (Project)
zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Rename variables, fix stride check, add two tests and one more remark.

Apr 28 2021, 3:45 PM · Unknown Object (Project)
zhuhan0 added inline comments to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.
Apr 28 2021, 12:16 PM · Unknown Object (Project)
zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

@tpopp I cannot reproduce your test failure with opt -O2 and -O3. My patch only affects memcpy intrinsics in the loop body. Therefore running your test case shouldn't hit my code. Output of opt -O3:

; ModuleID = 'reverse_4d_float_array.ll'
source_filename = "__compute_module"
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"
Apr 28 2021, 11:45 AM · Unknown Object (Project)

Apr 27 2021

zhuhan0 committed rG75d6b8bb4056: [loop-idiom] Hoist loop memcpys to loop preheader (authored by zhuhan0).
[loop-idiom] Hoist loop memcpys to loop preheader
Apr 27 2021, 5:41 PM
zhuhan0 closed D97667: [loop-idiom] Hoist loop memcpys to loop preheader.
Apr 27 2021, 5:40 PM · Unknown Object (Project)
zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

typo

Apr 27 2021, 5:04 PM · Unknown Object (Project)
zhuhan0 committed rGcd13f19031eb: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function (authored by zhuhan0).
[loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function
Apr 27 2021, 1:43 PM
zhuhan0 closed D100979: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function.
Apr 27 2021, 1:43 PM · Unknown Object (Project)

Apr 22 2021

zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

This was already accepted and you fixed build break, I think you can try to reland it.

Apr 22 2021, 3:52 PM · Unknown Object (Project)
zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Rebase.

Apr 22 2021, 3:26 PM · Unknown Object (Project)
zhuhan0 updated the diff for D100979: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function.

Address comment.

Apr 22 2021, 3:24 PM · Unknown Object (Project)
zhuhan0 added inline comments to D100979: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function.
Apr 22 2021, 2:04 PM · Unknown Object (Project)
zhuhan0 added inline comments to D100979: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function.
Apr 22 2021, 1:49 PM · Unknown Object (Project)

Apr 21 2021

zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Address @hoy's comments.

Apr 21 2021, 11:09 AM · Unknown Object (Project)
zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Also split the preparatory change away into an NFC patch https://reviews.llvm.org/D100979.

Apr 21 2021, 11:05 AM · Unknown Object (Project)
zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Fix build break. The breakage was a situation where the memcpy source and destination were of different types/sizes. Abort the transformation if that's the case. Also added a test case memcpy-intrinsic-different-types.ll.

Apr 21 2021, 11:02 AM · Unknown Object (Project)
zhuhan0 updated the summary of D100979: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function.
Apr 21 2021, 10:43 AM · Unknown Object (Project)
zhuhan0 updated the diff for D100979: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function.

Add back comments.

Apr 21 2021, 10:41 AM · Unknown Object (Project)
zhuhan0 requested review of D100979: [loop-idiom][NFC] Extract processLoopStoreOfLoopLoad into a helper function.
Apr 21 2021, 10:25 AM · Unknown Object (Project)

Mar 30 2021

zhuhan0 updated subscribers of D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

@lebedev.ri @zino is the replacement account for @zinob. He had some issue with the old account and couldn't retrieve it.

Mar 30 2021, 10:11 AM · Unknown Object (Project)

Mar 29 2021

zhuhan0 committed rG92ddd3c1b6cd: [loop-idiom] Hoist loop memcpys to loop preheader (authored by zhuhan0).
[loop-idiom] Hoist loop memcpys to loop preheader
Mar 29 2021, 11:42 PM
zhuhan0 closed D97667: [loop-idiom] Hoist loop memcpys to loop preheader.
Mar 29 2021, 11:42 PM · Unknown Object (Project)
zhuhan0 added a reverting change for rGdeb5095833a8: [loop-idiom] Hoist loop memcpys to loop preheader: rG2bd4049ceb82: Revert "[loop-idiom] Hoist loop memcpys to loop preheader".
Mar 29 2021, 11:36 PM
zhuhan0 committed rG2bd4049ceb82: Revert "[loop-idiom] Hoist loop memcpys to loop preheader" (authored by zhuhan0).
Revert "[loop-idiom] Hoist loop memcpys to loop preheader"
Mar 29 2021, 11:36 PM
zhuhan0 committed rGdeb5095833a8: [loop-idiom] Hoist loop memcpys to loop preheader (authored by zhuhan0).
[loop-idiom] Hoist loop memcpys to loop preheader
Mar 29 2021, 11:27 PM

Mar 23 2021

zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Typo in description: "perheader".

Mar 23 2021, 9:43 AM · Unknown Object (Project)
zhuhan0 retitled D97667: [loop-idiom] Hoist loop memcpys to loop preheader from [loop-idiom] Hoist loop memcpys to loop perheader to [loop-idiom] Hoist loop memcpys to loop preheader.
Mar 23 2021, 9:43 AM · Unknown Object (Project)

Mar 17 2021

zhuhan0 added a comment to D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Friendly ping. I could ask my colleagues to review this, but would appreciate some community feedback. I didn't find a clear code owner for this pass, so I simply put the top contributors to LoopIdiomRecognize.cpp as reviewers. Please let me know if I should put somebody else.

Mar 17 2021, 1:19 PM · Unknown Object (Project)

Mar 7 2021

zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Add function name to optimization remarks.

Mar 7 2021, 10:39 PM · Unknown Object (Project)

Mar 1 2021

zhuhan0 updated the diff for D97667: [loop-idiom] Hoist loop memcpys to loop preheader.

Fix linter.

Mar 1 2021, 10:46 AM · Unknown Object (Project)
zhuhan0 requested review of D97667: [loop-idiom] Hoist loop memcpys to loop preheader.
Mar 1 2021, 1:21 AM · Unknown Object (Project)

Dec 4 2020

zhuhan0 added a comment to D92560: [lib/Object, tools] - Make ELFObjectFile::getELFFile return reference..

Sorry nvm, this is already fixed.

Dec 4 2020, 3:35 PM · Unknown Object (Project)
zhuhan0 added a comment to D92560: [lib/Object, tools] - Make ELFObjectFile::getELFFile return reference..

Hello, this seems to break the build. Error here http://lab.llvm.org:8011/#/builders/16/builds/2910/steps/5/logs/stdio. Line 46 of llvm/tools/llvm-profgen/ProfiledBinary.cpp should now take a reference instead of pointer.

Dec 4 2020, 3:10 PM · Unknown Object (Project)

Jun 24 2020

zhuhan0 added a comment to D82516: [openmp] Use config.test_extra_flags in archer and multiplex tests.

Thanks @jdoerfert! I don't yet have commit access. Could you commit this for me?

Jun 24 2020, 10:45 PM · Restricted Project
zhuhan0 updated the summary of D82516: [openmp] Use config.test_extra_flags in archer and multiplex tests.
Jun 24 2020, 6:29 PM · Restricted Project
zhuhan0 created D82516: [openmp] Use config.test_extra_flags in archer and multiplex tests.
Jun 24 2020, 5:58 PM · Restricted Project

Jun 23 2020

zhuhan0 added a comment to D81176: [HIP] Add default header and include path.

This broke a test clang/test/Tooling/clang-check-offload.cpp for a critical Linux distro at Facebook. With this change, the test adds a -include __clang_hip_runtime_wrapper argument. The wrapper includes some standard c++ headers, but our distro don't have those headers in the default include paths, thus causing a break.

I notice this behavior doesn't happen for CUDA tests, which also rely on a similar __clang_cuda_runtime_wrapper. I think what's causing the difference is the different handling of nogpuinc/nogpulib option. My knowledge on this area is limited, so correct me if I'm wrong. CUDA seems to respect nogpuinc and doesn't include its wrapper if the flag is provided: https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/ToolChains/Cuda.cpp#L255. But based on this change, HIP does things differently: https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/ToolChains/AMDGPU.cpp#L226.

If I modify RocmInstallationDetector::AddHIPIncludeArgs to also respect nogpuinc/nogpulib, the test will pass for us. Is it a mistake for HIP to always include the wrapper file? Could you provide a fix for this issue? Thanks!

Thanks for investigating the issue. It makes sense to respect nogpuinc and nogpulib. fixed by 2580635bd2f3c0527353e4d7823326cd9f92ff7c

Jun 23 2020, 12:21 PM · Restricted Project

Jun 21 2020

zhuhan0 added a comment to D81176: [HIP] Add default header and include path.

This broke a test clang/test/Tooling/clang-check-offload.cpp for a critical Linux distro at Facebook. With this change, the test adds a -include __clang_hip_runtime_wrapper argument. The wrapper includes some standard c++ headers, but our distro don't have those headers in the default include paths, thus causing a break.

Jun 21 2020, 11:57 PM · Restricted Project

May 6 2020

zhuhan0 added a comment to D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

@smeenai Yes please. Thanks!

May 6 2020, 7:20 PM · Restricted Project
zhuhan0 updated the diff for D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

Address comment

May 6 2020, 5:38 PM · Restricted Project

May 4 2020

zhuhan0 updated the diff for D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

Rebase

May 4 2020, 10:43 AM · Restricted Project

Apr 28 2020

zhuhan0 added a comment to D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

Thanks @hans My bad. Didn't test this when LLVM_ENABLE_PIC=OFF.

Apr 28 2020, 7:27 PM · Restricted Project
zhuhan0 updated the diff for D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

Spacing.

Apr 28 2020, 7:27 PM · Restricted Project
zhuhan0 added reviewers for D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON: smeenai, modocache, beanz, phosek.
Apr 28 2020, 7:27 PM · Restricted Project
zhuhan0 updated the summary of D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 28 2020, 7:27 PM · Restricted Project
zhuhan0 updated the summary of D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 28 2020, 7:27 PM · Restricted Project
zhuhan0 updated the summary of D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 28 2020, 7:27 PM · Restricted Project
zhuhan0 updated the summary of D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 28 2020, 7:27 PM · Restricted Project
zhuhan0 updated the summary of D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 28 2020, 6:54 PM · Restricted Project
zhuhan0 created D79059: Fix and re-submit D78534 - [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 28 2020, 6:54 PM · Restricted Project

Apr 27 2020

zhuhan0 added a comment to D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

@smeenai Thank you!

Apr 27 2020, 2:00 PM · Restricted Project
zhuhan0 added a comment to D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

@smeenai Yes.

Apr 27 2020, 1:30 PM · Restricted Project

Apr 26 2020

zhuhan0 added a comment to D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

Hello @beanz @phosek @smeenai any comment on this patch? :)

Apr 26 2020, 9:15 PM · Restricted Project
zhuhan0 updated the diff for D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

Rebase

Apr 26 2020, 9:15 PM · Restricted Project

Apr 21 2020

zhuhan0 updated the diff for D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.

Spacing

Apr 21 2020, 10:14 AM · Restricted Project

Apr 20 2020

zhuhan0 updated the summary of D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 20 2020, 11:25 PM · Restricted Project
zhuhan0 added reviewers for D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON: chandlerc, bogner, smeenai, modocache.
Apr 20 2020, 11:18 PM · Restricted Project
zhuhan0 updated the summary of D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 20 2020, 9:41 PM · Restricted Project
zhuhan0 created D78534: [libclang] Install both libclang.a and libclang.so when LIBCLANG_BUILD_STATIC=ON.
Apr 20 2020, 9:40 PM · Restricted Project