Page MenuHomePhabricator

linzj (zuojian lin)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 26 2018, 10:02 PM (105 w, 22 h)

Recent Activity

Aug 26 2020

linzj requested review of D86680: Tune the Greedy RA to prefer split by region in some cases..
Aug 26 2020, 10:51 PM · Restricted Project

Aug 19 2020

linzj updated the summary of D86191: Fix AArch64's Generating Ineffective Load/Store With Large Offset..
Aug 19 2020, 1:21 AM · Restricted Project
linzj updated the diff for D86191: Fix AArch64's Generating Ineffective Load/Store With Large Offset..

Fix the unpassed tests.
Only split the constant when it would cause the one more move instruction.

Aug 19 2020, 1:20 AM · Restricted Project

Aug 18 2020

linzj updated the diff for D86191: Fix AArch64's Generating Ineffective Load/Store With Large Offset..

Fix variable style && Only handle ISD:ADD for Address.

Aug 18 2020, 11:39 PM · Restricted Project
linzj updated the diff for D86191: Fix AArch64's Generating Ineffective Load/Store With Large Offset..

The "Address" operand supports more than one use.

Aug 18 2020, 11:00 PM · Restricted Project
linzj requested review of D86191: Fix AArch64's Generating Ineffective Load/Store With Large Offset..
Aug 18 2020, 8:29 PM · Restricted Project

Jul 13 2020

linzj added a comment to D81631: Fix undefined behavior in Dwarf..

Yep - sure, the test case should not be included. (I don't think I can actually approve a specific prior revision of the patch in Phab) - are you able to commit the initialization or would you like me to?

Jul 13 2020, 6:27 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

I think I should not attach this test case then.
You should not accept this patch. Instead you should accept the previous one.
Valgrind won't work in the Windows environment.

Jul 13 2020, 1:57 AM · Restricted Project

Jul 9 2020

linzj added a comment to D81631: Fix undefined behavior in Dwarf..
  • bool SameAsPrevCU = this == DD->getPrevCU();

+ const DwarfCompileUnit *PrevCU = DD->getPrevCU();

Jul 9 2020, 4:23 AM · Restricted Project

Jun 20 2020

linzj added a comment to D81631: Fix undefined behavior in Dwarf..

Any ideas why my attempt to reproduce the issue with valgrind might not have worked as it has for you?

Jun 20 2020, 7:36 PM · Restricted Project

Jun 19 2020

linzj added a comment to D81631: Fix undefined behavior in Dwarf..

I think memory sanitizer is buggy...

Jun 19 2020, 2:07 AM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

use libc++ but the same error emitted!

Jun 19 2020, 1:02 AM · Restricted Project

Jun 18 2020

linzj added a comment to D81631: Fix undefined behavior in Dwarf..

The bug from libstdc++, switching to libc++.

Jun 18 2020, 11:57 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

Then the memory sanitizer finds another bug when compiling:

2397==WARNING: MemorySanitizer: use-of-uninitialized-value

#0 0xb210e7 in llvm::StringRef::find(char, unsigned long) const /home/linzj/ssdsrc/llvm-project2/llvm/building-release/../include/llvm/ADT/StringRef.h:322:29
#1 0xb210e7 in llvm::StringRef::split(llvm::SmallVectorImpl<llvm::StringRef>&, char, int, bool) const /home/linzj/ssdsrc/llvm-project2/llvm/building-release/../lib/Support/StringRef.cpp:344:20
#2 0xb2b6d4 in llvm::Triple::Triple(llvm::Twine const&) /home/linzj/ssdsrc/llvm-project2/llvm/building-release/../lib/Support/Triple.cpp:739:19
#3 0xb63b3c in llvm::sys::getProcessTriple[abi:cxx11]() /home/linzj/ssdsrc/llvm-project2/llvm/building-release/../lib/Support/Host.cpp:1615:10
#4 0xadecab in (anonymous namespace)::CommandLineParser::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, bool) /home/linzj/ssdsrc/llvm-project2/llvm/building-release/../lib/Support/CommandLine.cpp:1347:17
#5 0xadecab in llvm::cl::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, char const*, bool) /home/linzj/ssdsrc/llvm-project2/llvm/building-release/../lib/Support/CommandLine.cpp:1322:24
#6 0xa90283 in main /home/linzj/ssdsrc/llvm-project2/llvm/building-release/../utils/TableGen/TableGen.cpp:265:3
#7 0x7fc23a9d4b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
#8 0x426c69 in _start (/media/linzj/ff6fd1aa-94f2-4f61-9aba-67c6c99a0a59/home/linzj/src/llvm-project2/llvm/building-release/bin/llvm-tblgen+0x426c69)
Jun 18 2020, 10:51 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

I think I have used to wrong sanitizer. Should be "Memory", not "Undefined".

Jun 18 2020, 10:51 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

I can't reproduce the bug with ubsan! Even in the latest version.
But valgrind is able to reproduce it.

Jun 18 2020, 9:16 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

Oh - hmm. I don't seem to reproduce this myself with "clang++ ^.cc -g -c -O3" running under valgrind. Is there something else I should be doing to reproduce/validate this?

It should add -target armv7-linux-android. Or you should simply run llc with my test case.

Jun 18 2020, 6:35 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

Could you include a comment in the test case explaining how this IR differs from all the IR clang usually generates? (in general what's interesting about this IR)

Also - remove the "valgrind" usage from that llc invocation (test machines might not have valgrind, etc - does UBSan/ASan/MSan catch this? There are buildbots that'll run the tests with sanitizers like those enabled & it'd be good if the test could catch a regression at least on those buildbots) - and include some testing of the behavior of llc (ie: what behavior do we get instead of UB? Presumably there's some specific behavior we're expecting beyond "anything other than crashing")

Jun 18 2020, 5:31 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

Could you include a comment in the test case explaining how this IR differs from all the IR clang usually generates? (in general what's interesting about this IR)

Also - remove the "valgrind" usage from that llc invocation (test machines might not have valgrind, etc - does UBSan/ASan/MSan catch this? There are buildbots that'll run the tests with sanitizers like those enabled & it'd be good if the test could catch a regression at least on those buildbots) - and include some testing of the behavior of llc (ie: what behavior do we get instead of UB? Presumably there's some specific behavior we're expecting beyond "anything other than crashing")

Jun 18 2020, 5:31 PM · Restricted Project
linzj updated the diff for D81631: Fix undefined behavior in Dwarf..

Add testcase.

Jun 18 2020, 12:30 AM · Restricted Project

Jun 15 2020

linzj added a comment to D81632: Fix undefined behavior in PeepholeOptimizer..

Which platform did you run valgrind on? The x86 platform should set SubIdx on all paths through it...

Jun 15 2020, 8:23 PM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

Is this UB codepath reached by existing test cases running in check-llvm? Or was it found on some other testing?

Jun 15 2020, 6:46 PM · Restricted Project
linzj added a comment to D81632: Fix undefined behavior in PeepholeOptimizer..

I think SubIdx is supposed to be set by TII->isCoalescableExtInstr(). If it's not doing that, then the error's probably in that call and not in this function.

Then most target instr infos need to patch.

Jun 15 2020, 2:41 AM · Restricted Project
linzj added a comment to D81631: Fix undefined behavior in Dwarf..

I am not a commiter, please commit this patch for me.

Jun 15 2020, 2:41 AM · Restricted Project

Jun 11 2020

linzj added a reviewer for D81631: Fix undefined behavior in Dwarf.: aprantl.
Jun 11 2020, 7:15 PM · Restricted Project
linzj added reviewers for D81632: Fix undefined behavior in PeepholeOptimizer.: MatzeB, hans, void.
Jun 11 2020, 7:15 PM · Restricted Project
linzj created D81632: Fix undefined behavior in PeepholeOptimizer..
Jun 11 2020, 12:01 AM · Restricted Project

Jun 10 2020

linzj created D81631: Fix undefined behavior in Dwarf..
Jun 10 2020, 11:25 PM · Restricted Project

Mar 5 2020

linzj added a comment to D67147: Remove the additional constant which requires an extra register for statepoint lowering..

@arsenm , looks good to you?

Mar 5 2020, 10:58 PM · Restricted Project

Mar 3 2020

linzj added a comment to D67147: Remove the additional constant which requires an extra register for statepoint lowering..

I think it's fine to go back to the main stream.

Mar 3 2020, 2:09 AM · Restricted Project

Mar 2 2020

linzj updated the diff for D67147: Remove the additional constant which requires an extra register for statepoint lowering..

Rebase again. I don't think the failed unit test is relevant to my change.

Mar 2 2020, 6:33 PM · Restricted Project
linzj updated the diff for D67147: Remove the additional constant which requires an extra register for statepoint lowering..

Fix test case miss RUN comment.

Mar 2 2020, 1:54 AM · Restricted Project

Mar 1 2020

linzj updated the diff for D67147: Remove the additional constant which requires an extra register for statepoint lowering..

Rebase from the master.

Mar 1 2020, 10:46 PM · Restricted Project
linzj added a comment to D67147: Remove the additional constant which requires an extra register for statepoint lowering..

Can you rebase this? I think a similar patch conflicts (a6f38b46972e4e6978c3a768001903d3f3334cb7)

Mar 1 2020, 5:44 PM · Restricted Project

Feb 26 2020

linzj added a comment to D67147: Remove the additional constant which requires an extra register for statepoint lowering..

When the commit will be landed?

If you need someone to commit a patch for you, you should explicitly state so. I can try to commit this in the next day or so

Feb 26 2020, 6:52 PM · Restricted Project
linzj added a comment to D67147: Remove the additional constant which requires an extra register for statepoint lowering..

When the commit will be landed?

Feb 26 2020, 6:07 PM · Restricted Project

Nov 11 2019

linzj added a comment to D66459: Make ShrinkWrap more consistent..

V8 needs to save a specific set of registers at the entry of a function depending on the type of this function. For example, a JS function needs to save r0, r1,r7 along with fp, lr. And a wasm function needs to spill r3 at sp - 16.

So, these registers essentially hold argument values?

Yes. They are argument values.

But they are CSRs in the ShrinkWrap context. For example, If a JS function use/def r1 in the a basic block but ShrinkWrap move the save block to one of its successor, that will be a trouble.

I think ShrinkWrap pass is the wrong place to solve this problem. Could you, please, look at the how the registers, which correspond to vararg arguments of a variadic function are saved to
designated slots on the stack (check all mentions of ArgRegsSaveSize in ARMFrameLowering.cpp)? Perhaps you could do something similar?

Nov 11 2019, 8:35 PM · Restricted Project

Sep 18 2019

linzj added a comment to D66459: Make ShrinkWrap more consistent..

You can try to reproduce the behavior of the calling convention through a MIR test: https://llvm.org/docs/MIRLangRef.html, using $REG = IMPLICIT_DEF to clobber a CSR.

Not that simple. Your solution just handles the call instructions. The the prologue is inserted by the prologue inserter. I can't simply add a prologue to a function's MIR script, right?

What I was suggesting is to write a MIR test that starts the compilation from the ShrinkWrap pass and goes through PrologEpilogInserter (or all the way to the end), then check the output.

To do that, you can generate the MIR test with llc -stop-before shrink-wrap with your patch applied, and use $REG = IMPLICIT_DEF to strip out everything related to your downstream code. Then using llc -start-before shrink-wrap -stop-after prologepilog should allow you to check if the prologue/epilogue has been inserted at the right place.
Another solution would be to use the debug output of the ShrinkWrap pass (llc -run-pass shrink-wrap -debug-only=shrink-wrap), but that will only be tested with asserts enabled.

I may be getting all of this wrong, so let me know if that doesn't make sense for your use case.

Sep 18 2019, 5:55 PM · Restricted Project

Sep 17 2019

linzj added a comment to D66459: Make ShrinkWrap more consistent..

You can try to reproduce the behavior of the calling convention through a MIR test: https://llvm.org/docs/MIRLangRef.html, using $REG = IMPLICIT_DEF to clobber a CSR.

Not that simple. Your solution just handles the call instructions. The the prologue is inserted by the prologue inserter. I can't simply add a prologue to a function's MIR script, right?

Sep 17 2019, 10:56 PM · Restricted Project

Sep 15 2019

linzj added a comment to D66459: Make ShrinkWrap more consistent..

You need to clone https://github.com/linzj/llvm-toy, then checkout the branch named arm-tf-6_9_427_23. Then apply the patch llvm-patch-by-far.patch to llvm 8.0. So that you can compile the test case as follow. Because of a new calling convention v8cc.
the test case:

; ModuleID = 'main'
source_filename = "main"
target triple = "armv7-unknown-unknown-v8"
Sep 15 2019, 6:27 PM · Restricted Project

Sep 6 2019

linzj added a comment to D67257: New statepoint spilling mechanism.

Hi,

I don't think this patch is correct in the sense that having statepoints depend on GreedyRegAlloc is a non-starter.
Indeed, that means that now any configuration that doesn't use greedy reg alloc (like fast or basic reg alloc) will generate incorrect code with respect to state point spilling.

What problem do you see with the current handling of statepoints?

Cheers,
-Quentin

Sep 6 2019, 8:32 PM · Restricted Project
linzj added a comment to D66459: Make ShrinkWrap more consistent..

Thanks for upstreaming your changes.

I am not sure I understand what you are trying to fix, similar to @chill's request, can you please provide an example (ideally, as a test case) of what this fixes? Using MIR with llc -run-pass=shrink-wrap might help you creating a more precise test case for shrink-wrapping.

Sep 6 2019, 5:48 AM · Restricted Project

Sep 5 2019

linzj updated the diff for D67257: New statepoint spilling mechanism.

Remove an unused function.

Sep 5 2019, 11:51 PM · Restricted Project
linzj updated the diff for D67257: New statepoint spilling mechanism.

Remove an unused include file.

Sep 5 2019, 11:51 PM · Restricted Project
linzj updated the diff for D67257: New statepoint spilling mechanism.

Remove logs.

Sep 5 2019, 11:44 PM · Restricted Project
linzj created D67257: New statepoint spilling mechanism.
Sep 5 2019, 11:40 PM · Restricted Project

Sep 4 2019

linzj updated the diff for D67147: Remove the additional constant which requires an extra register for statepoint lowering..

Use undef SDValue instead.

Sep 4 2019, 7:47 PM · Restricted Project
linzj added inline comments to D67147: Remove the additional constant which requires an extra register for statepoint lowering..
Sep 4 2019, 6:57 PM · Restricted Project
linzj added a reviewer for D67147: Remove the additional constant which requires an extra register for statepoint lowering.: arsenm.
Sep 4 2019, 6:10 PM · Restricted Project
linzj added a reviewer for D67147: Remove the additional constant which requires an extra register for statepoint lowering.: igor-laevsky.
Sep 4 2019, 6:10 PM · Restricted Project
linzj created D67147: Remove the additional constant which requires an extra register for statepoint lowering..
Sep 4 2019, 12:47 AM · Restricted Project

Sep 2 2019

linzj abandoned D67068: A instruction bitcast a constant, and get used across the basic block will generate additional COPY SDNode.The example as follow:.

I think the ConstantHoist have its job well done, maybe reload a constant from a stack slot is a good idea.

Sep 2 2019, 6:23 PM · Restricted Project
linzj added a comment to D67068: A instruction bitcast a constant, and get used across the basic block will generate additional COPY SDNode.The example as follow:.

tests missing.
From the first look this fix seems rather ad-hoc.

Sep 2 2019, 5:34 AM · Restricted Project
linzj created D67068: A instruction bitcast a constant, and get used across the basic block will generate additional COPY SDNode.The example as follow:.
Sep 2 2019, 3:27 AM · Restricted Project

Aug 21 2019

linzj added inline comments to D66459: Make ShrinkWrap more consistent..
Aug 21 2019, 12:59 AM · Restricted Project

Aug 20 2019

linzj added inline comments to D66459: Make ShrinkWrap more consistent..
Aug 20 2019, 6:11 PM · Restricted Project

Aug 19 2019

linzj created D66459: Make ShrinkWrap more consistent..
Aug 19 2019, 6:48 PM · Restricted Project

Nov 26 2018

linzj added a comment to D54929: Support StackMaps For ARM.

This patch pass the test:

; ModuleID = 'test'
source_filename = "test"
target triple = "armv7-linux-android"
Nov 26 2018, 10:15 PM
linzj added reviewers for D54929: Support StackMaps For ARM: grosbach, lattner, rafaelauler.
Nov 26 2018, 10:13 PM
linzj created D54929: Support StackMaps For ARM.
Nov 26 2018, 10:09 PM