Page MenuHomePhabricator

Please use GitHub pull requests for new patches. Phabricator shutdown timeline

shiva0217 (Shiva Chen)
User

Projects

User does not belong to any projects.

User Details

User Since
Dec 25 2016, 5:14 PM (352 w, 5 d)

Recent Activity

Aug 17 2023

shiva0217 added inline comments to D143465: [LoopVectorize] Vectorize the reduction pattern of integer min/max with index..
Aug 17 2023, 1:59 AM · Restricted Project, Restricted Project

Aug 7 2023

shiva0217 added inline comments to D150851: [LoopVectorize] Vectorize select-cmp reduction pattern for increasing integer induction variable.
Aug 7 2023, 11:53 PM · Restricted Project, Restricted Project

Jul 20 2023

shiva0217 added a comment to D152693: LoopVectorize: introduce RecurKind::Induction(I|F)(Max|Min).

Hi Ram,

Jul 20 2023, 9:05 PM · Restricted Project, Restricted Project

Jul 12 2023

shiva0217 accepted D153936: [LV] Add tests for select-cmp reduction pattern. (NFC).

LGTM

Jul 12 2023, 11:11 PM · Restricted Project, Restricted Project

Jul 11 2023

shiva0217 added inline comments to D150851: [LoopVectorize] Vectorize select-cmp reduction pattern for increasing integer induction variable.
Jul 11 2023, 8:23 PM · Restricted Project, Restricted Project

Jun 21 2023

shiva0217 added inline comments to D150851: [LoopVectorize] Vectorize select-cmp reduction pattern for increasing integer induction variable.
Jun 21 2023, 1:18 AM · Restricted Project, Restricted Project

Jun 14 2023

shiva0217 added a comment to D152279: [Driver] Default -msmall-data-limit= to 0.

However, RISC-V -msmall-data-limit= is probably a case warranting a difference.
The global pointer relaxation has a very limited value (benchmarked by multiple parties, including a party which implemented this feature in the GNU toolchain: even they can only say the optimization only applies to very specific projects).
The default value is confusing: as explained by the summary.

I suspect that -msmall-data-limit=8 is too conservative, maybe 16 would be better, I don't know. I think global pointer relaxation users should toggle this by themselves, not relying on 0 or 8 default decided by a bunch of strange conditions.

I don't disagree that the small data limit being 8 rather than something else doesn't seem to be particularly well motivated, but I understand that the case where the option does make a difference is on embedded targets (I think the data that was shared before was for SPEC, but could be wrong?). I think we can generally expect more willingness for people targeting embedded systems to explore different compiler flags,

Agree.

but just matching gcc does feel like a better default. What do you think about keeping the default for bare metal targets?

I am unsure we want to add the complexity and refrain from changing the default for bare metal targets due to haunted graveyards https://www.usenix.org/sites/default/files/conference/protected-files/srecon17americas_slides_reese.pdf

We are already different from GCC in a number of ways:

  • for -fpie, we may emit .sdata/.sbss but GCC won't
  • we accept -G while GCC doesn't.
  • we don't emit .srodata.

I made a comment on https://lists.riscv.org/g/sig-toolchains/message/619 and informed GCC folks in case they can change the default as well.
If they don't, I think we made a good choice for not following this particular behavior.

(I feel sad that I did not see D57497 and it landed with a blocked review. If we started from scratch, we would probably run into a cleaner state.)

Jun 14 2023, 8:38 PM · Restricted Project, Restricted Project

Jun 6 2023

shiva0217 added inline comments to D151988: LoopVectorize: extend SelectCmp pattern for non-invariants.
Jun 6 2023, 2:58 AM · Restricted Project, Restricted Project

May 18 2023

shiva0217 added a comment to D150671: RISCV/InstrInfo: model register pressure for MICombiner.

Include test, from a benchmark run reduced by hand.

I know the test isn't pretty, but it's the best I could do within reasonable time.

May 18 2023, 7:07 PM · Restricted Project, Restricted Project

May 17 2023

shiva0217 added a comment to D150664: MachineCombiner: use height in improvesCriticialPathLen().

Theoretically, NewRootHeight and OldRootHeight should be equal.
Does it make sense to remove the Heights calculations?

May 17 2023, 12:04 AM · Restricted Project, Restricted Project

May 16 2023

shiva0217 added inline comments to D150664: MachineCombiner: use height in improvesCriticialPathLen().
May 16 2023, 8:49 PM · Restricted Project, Restricted Project

May 10 2023

shiva0217 added a comment to D150192: Allow clang to emit inrange metadata when generating code for array subscripts.

From what I recall, "inrange" is actually more restrictive than the normal C/C++ array indexing rules. Specifically, the bits regarding comparisons. "inrange" was designed to allow splitting globals indexed using inrange.

That isn't to say that functionality like this isn't useful, but we probably need to call it something different. And I'm not sure an attribute on a GEP is actually the best way to represent the semantics. It might make sense to use a separate intrinsic to represent this, especially given the direction of https://discourse.llvm.org/t/rfc-replacing-getelementptr-with-ptradd/68699 .

May 10 2023, 3:46 AM · Restricted Project, Restricted Project, Restricted Project

Apr 1 2023

shiva0217 added a comment to D143248: Emit CFI directives in epilogue and enable CFIFixup pass for RISC-V..

Hi Varun,

It might be good to have a simple case to illustrate that cfi_remember_state and cfi_restore_state can be generated properly with epilogue CFI.
For examle, could the following case generated with cfi_remember_state and cfi_restore_state as GCC?

extern void foo(void);
void f(int *i) {
  if (*i == 0) {
    *i = 1;
    foo();
    return;
  } else {
    __builtin_printf("Hi");
    *i=0;
  }
}

Hi Shiva, the following is the assembly emitted.

f:
.Lfunc_begin0:
	.loc	0 2 0
	.cfi_startproc
	addi	sp, sp, -16
	.cfi_def_cfa_offset 16
	sd	ra, 8(sp)
	sd	s0, 0(sp)
	.cfi_offset ra, -8
	.cfi_offset s0, -16
	.cfi_remember_state
	mv	s0, a0
.Ltmp0:
	.loc	0 3 6 prologue_end
	lw	a0, 0(a0)
.Ltmp1:
	.loc	0 3 6 is_stmt 0
	beqz	a0, .LBB0_2
.Ltmp2:
	.loc	0 8 3 is_stmt 1
	lui	a0, %hi(.L.str)
	addi	a0, a0, %lo(.L.str)
	call	printf
.Ltmp3:
	.loc	0 9 5
	sw	zero, 0(s0)
.Ltmp4:
	.loc	0 11 1
	ld	ra, 8(sp)
	ld	s0, 0(sp)
.Ltmp5:
	.cfi_restore ra
	.cfi_restore s0
	.loc	0 11 1 epilogue_begin is_stmt 0
	addi	sp, sp, 16
	.cfi_def_cfa_offset 0
	ret
.LBB0_2:
	.cfi_restore_state
.Ltmp6:
	.loc	0 0 1
	li	a0, 1
.Ltmp7:
	.loc	0 4 6 is_stmt 1
	sw	a0, 0(s0)
	.loc	0 5 3
	ld	ra, 8(sp)
	ld	s0, 0(sp)
.Ltmp8:
	.cfi_restore ra
	.cfi_restore s0
	.loc	0 5 3 epilogue_begin is_stmt 0
	addi	sp, sp, 16
	.cfi_def_cfa_offset 0
.Ltmp9:
	tail	foo
.Ltmp10:
.Lfunc_end0:
	.size	f, .Lfunc_end0-f
	.cfi_endproc
Apr 1 2023, 1:21 AM · Restricted Project, Restricted Project

Feb 16 2023

shiva0217 added a comment to D143248: Emit CFI directives in epilogue and enable CFIFixup pass for RISC-V..

Hi Varun,

Feb 16 2023, 2:43 AM · Restricted Project, Restricted Project

Feb 5 2023

shiva0217 added a comment to D79378: PR34581: Don't remove an 'if (p)' guarding a call to 'operator delete(p)' under -Oz..

Hi,

I have a question for the delete function call sinking in -Oz.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf.
According to 3.7.4.2/3
The value of the first argument supplied to a deallocation function may be a null pointer value; if so, and if the deallocation function is one supplied in the standard library, the call has no effect. Otherwise, the behavior is undefined

It seems the null checking can be skipped only when the delete is not from the standard library(have been overloaded by the user), isn't it?

The paragraph you just quoted says that the deallocation functions provided by the standard library are required have no effect on null pointers. That means it's fine to call them with a null pointer even if the source wouldn't normally execute that call. We could just insert these calls into random other code if we wanted to.

Is a null operand of delete in the source code no effect because there will be null pointer checking generated? Or the delete(null) in assembly code also valid?

In [expr.delete], the standard specifies that using the delete operator on a null pointer is required to have no effect. It does not specify how that should be implemented. In [basic.std.dynamic.deallocation], the standard also specifies that the library-provided operator delete functions must have no effect when given a null pointer. This requirement applies no matter how the function is called, so yes, a call from assembly that passed a null pointer would also be required to have no effect. More officially, you can simply take the address of operator delete, yielding an rvalue of void (*)(void *) (or similar, depending on which operator delete you use), which can then be called later in a context that doesn't understand it's calling a deallocation function; such a call is still required to have no effect when passing a null pointer, because the requirement is laid on the function, separate from the circumstances of it being called as part of the delete operator.

Note also that calling operator delete unconditionally when implementing the delete operator is explicitly blessed by [expr.delete]p7:

If the value of the operand of the delete-expression is not a null pointer value, then:

...

Otherwise, it is unspecified whether the deallocation function will be called.

Feb 5 2023, 8:33 PM · Restricted Project, Restricted Project, Restricted Project

Feb 3 2023

shiva0217 added a comment to D79378: PR34581: Don't remove an 'if (p)' guarding a call to 'operator delete(p)' under -Oz..

Hi,

I have a question for the delete function call sinking in -Oz.

https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3690.pdf.
According to 3.7.4.2/3
The value of the first argument supplied to a deallocation function may be a null pointer value; if so, and if the deallocation function is one supplied in the standard library, the call has no effect. Otherwise, the behavior is undefined

It seems the null checking can be skipped only when the delete is not from the standard library(have been overloaded by the user), isn't it?

The paragraph you just quoted says that the deallocation functions provided by the standard library are required have no effect on null pointers. That means it's fine to call them with a null pointer even if the source wouldn't normally execute that call. We could just insert these calls into random other code if we wanted to.

Feb 3 2023, 1:40 AM · Restricted Project, Restricted Project, Restricted Project

Feb 2 2023

Herald added a project to D79378: PR34581: Don't remove an 'if (p)' guarding a call to 'operator delete(p)' under -Oz.: Restricted Project.

I have a question for the delete function call sinking in -Oz.

Feb 2 2023, 8:41 PM · Restricted Project, Restricted Project, Restricted Project

Aug 9 2022

shiva0217 added a comment to D28638: [NDS32 1/46] Recognise nds32 in triple parsing code.

Did anything happen with these NDS32 patches?
Is there any effort to add support for it?

Aug 9 2022, 7:06 PM · Restricted Project

Apr 30 2020

shiva0217 accepted D79141: [RISCV] Better Split Stack Pointer Adjustment for RVC.

Update after shiva0217's review:

  • Update test to correctly show splitting on RV32*C
  • Use early return if CSI.size() == 0
  • Update comments to count bits correctly.

I decided against a getOffsetAddressableLimit function, as the logic in
getFirstSPAdjustAmount isn't just about addressable offsets, it's also about
what we can adjust in a single (compressed if possible) instruction, so I
thought that adding that function would make the logic harder to understand.

Got your point. The logic is not only for addressable but also for preference for code size.

Apr 30 2020, 2:07 AM · Restricted Project

Apr 29 2020

shiva0217 added inline comments to D79141: [RISCV] Better Split Stack Pointer Adjustment for RVC.
Apr 29 2020, 11:25 PM · Restricted Project

Apr 28 2020

shiva0217 added a comment to D78545: [RISCV] Make CanLowerReturn protected for downstream maintenance.

Although most of the targets declare these functions as private, I think it might worth changing to public. So the various downstream RISCV users may able to inherit the class and customize the functions for their ISA and return the basic class functions to utilize the original infrastructure. Any thoughts?

Apr 28 2020, 2:39 AM · Restricted Project

Mar 31 2020

shiva0217 committed rGaf0cd9073c3d: [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and… (authored by shiva0217).
[RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and…
Mar 31 2020, 8:55 PM
shiva0217 closed D77117: [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp.
Mar 31 2020, 8:55 PM · Restricted Project
shiva0217 added a comment to D77117: [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp.

@shiva0217 yeah, that sounds good. Please can you ensure you include some of that explanation in the commit message when you land this?

Mar 31 2020, 8:22 PM · Restricted Project
shiva0217 updated the summary of D77117: [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp.
Mar 31 2020, 8:22 PM · Restricted Project
shiva0217 added a comment to D77117: [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp.

Hi @shiva0217 can you clarify as to why this is necessary?

Mar 31 2020, 4:56 AM · Restricted Project
shiva0217 created D77117: [RISCV] Split RISCVISelDAGToDAG.cpp to RISCVISelDAGToDAG.h and RISCVISelDAGToDAG.cpp.
Mar 31 2020, 12:30 AM · Restricted Project

Mar 19 2020

shiva0217 committed rGfc3752665f4b: [RISCV] Passing small data limitation value to RISCV backend (authored by shiva0217).
[RISCV] Passing small data limitation value to RISCV backend
Mar 19 2020, 8:18 PM
shiva0217 closed D57497: [RISCV] Passing small data limitation value to RISCV backend.
Mar 19 2020, 8:18 PM · Restricted Project, Restricted Project

Mar 17 2020

shiva0217 updated the diff for D57497: [RISCV] Passing small data limitation value to RISCV backend.

Update patch to address @apazos's comments.

Mar 17 2020, 9:36 PM · Restricted Project, Restricted Project
shiva0217 added a comment to D57497: [RISCV] Passing small data limitation value to RISCV backend.

Shiva, how about making the flag small-data-limit alias of -msmall-data-threshold?

Mar 17 2020, 9:36 PM · Restricted Project, Restricted Project

Mar 15 2020

shiva0217 added a comment to D57497: [RISCV] Passing small data limitation value to RISCV backend.

Thanks Shiva, I res-ynced and rebuilt the patch. It is working fine.

I see there is a msmall-data-threshold flag used by Mips and Hexagon, and now we are adding a new flag msmall-data-limit. Should't we reuse the flag?

Hi Ana,
Thanks for trying the patch. msmall-data-limit is also a RISCV GCC flag, so I would recommend using the same flag as GCC.

How hard would it be to use the -msmall-data-threshold flag work if a -msmall-data-limit flag is not provided?

Mar 15 2020, 6:48 PM · Restricted Project, Restricted Project

Mar 12 2020

shiva0217 added a comment to D57497: [RISCV] Passing small data limitation value to RISCV backend.

Thanks Shiva, I res-ynced and rebuilt the patch. It is working fine.

I see there is a msmall-data-threshold flag used by Mips and Hexagon, and now we are adding a new flag msmall-data-limit. Should't we reuse the flag?

Mar 12 2020, 7:04 PM · Restricted Project, Restricted Project

Mar 11 2020

shiva0217 updated the diff for D57497: [RISCV] Passing small data limitation value to RISCV backend.

Update the patch to address @apazos's comments.

Mar 11 2020, 10:40 PM · Restricted Project, Restricted Project
shiva0217 added a comment to D57497: [RISCV] Passing small data limitation value to RISCV backend.

Shiva, I see a warning always being printed:

'+small-data-limit=' is not a recognized feature for this target (ignoring feature)

This is because it is being passed down as a target feature.

Might be good to add a test case to make sure the SmallDataLimit module flag is created, no target feature is passed, and that no warnings are printed.

Mar 11 2020, 10:33 PM · Restricted Project, Restricted Project

Mar 10 2020

shiva0217 updated the diff for D57497: [RISCV] Passing small data limitation value to RISCV backend.

Update patch to address @jrtc27's comment.

Mar 10 2020, 11:00 PM · Restricted Project, Restricted Project
shiva0217 updated the diff for D57497: [RISCV] Passing small data limitation value to RISCV backend.

Update patch to address @evandro's comments.

Mar 10 2020, 8:14 PM · Restricted Project, Restricted Project
shiva0217 updated the diff for D57497: [RISCV] Passing small data limitation value to RISCV backend.

Update patch to address @lenary's comments.

Mar 10 2020, 6:23 AM · Restricted Project, Restricted Project

Mar 9 2020

shiva0217 updated the diff for D57497: [RISCV] Passing small data limitation value to RISCV backend.

Rebase to the trunk

Mar 9 2020, 11:21 PM · Restricted Project, Restricted Project
shiva0217 added a comment to D57497: [RISCV] Passing small data limitation value to RISCV backend.

Shiva, we forgot about this patch. Can you rebase it so we move on with merging.

Mar 9 2020, 7:26 PM · Restricted Project, Restricted Project
shiva0217 committed rGc3d981aebaba: [RISCV] Add new SchedRead SchedWrite (authored by shiva0217).
[RISCV] Add new SchedRead SchedWrite
Mar 9 2020, 9:42 AM
shiva0217 closed D75515: [RISCV] Add new SchedRead and SchedWrite.
Mar 9 2020, 9:41 AM · Restricted Project
shiva0217 added a comment to D75515: [RISCV] Add new SchedRead and SchedWrite.

Hi @HsiangKai,
Thanks for the review.

Mar 9 2020, 9:08 AM · Restricted Project

Mar 5 2020

shiva0217 updated the diff for D75515: [RISCV] Add new SchedRead and SchedWrite.

Update the patch to address @HsiangKai's comments.

Mar 5 2020, 2:14 AM · Restricted Project

Mar 3 2020

shiva0217 created D75515: [RISCV] Add new SchedRead and SchedWrite.
Mar 3 2020, 4:35 AM · Restricted Project

Feb 17 2020

shiva0217 added a comment to D74596: [RISCV] Correct the CallPreservedMask for the function call in an interrupt handler.

The patch has landed with https://github.com/llvm/llvm-project/commit/1cae2f9d192c69833e22684ca338660942ab464e. I forgot to add the "Differential Revision:" in the commit message, so I closed the revision manually. Sorry for the inconvenience.

Feb 17 2020, 4:26 AM · Restricted Project

Feb 14 2020

shiva0217 closed D74596: [RISCV] Correct the CallPreservedMask for the function call in an interrupt handler.

Hi @lenary and @luismarques,
Thanks for the review.

Feb 14 2020, 5:34 PM · Restricted Project
shiva0217 committed rG1cae2f9d192c: [RISCV] Correct the CallPreservedMask for the function call in an interrupt… (authored by shiva0217).
[RISCV] Correct the CallPreservedMask for the function call in an interrupt…
Feb 14 2020, 5:16 PM
shiva0217 updated the diff for D74596: [RISCV] Correct the CallPreservedMask for the function call in an interrupt handler.

Update the patch to fix the typo.

Feb 14 2020, 5:07 PM · Restricted Project
shiva0217 created D74596: [RISCV] Correct the CallPreservedMask for the function call in an interrupt handler.
Feb 14 2020, 2:12 AM · Restricted Project

Feb 9 2020

shiva0217 committed rG64f417200e10: [RISCV] Fix incorrect FP base CFI offset for variable argument functions (authored by shiva0217).
[RISCV] Fix incorrect FP base CFI offset for variable argument functions
Feb 9 2020, 7:59 PM
shiva0217 closed D73862: [RISCV] Fix incorrect FP base CFI offset for variable argument functions.
Feb 9 2020, 7:59 PM · Restricted Project
shiva0217 updated the diff for D73862: [RISCV] Fix incorrect FP base CFI offset for variable argument functions.

Update the patch to address the comment.

Feb 9 2020, 7:28 PM · Restricted Project

Feb 2 2020

shiva0217 created D73862: [RISCV] Fix incorrect FP base CFI offset for variable argument functions.
Feb 2 2020, 10:13 PM · Restricted Project

Jan 13 2020

shiva0217 added inline comments to D68685: [RISCV] Scheduler description for Rocket Core.
Jan 13 2020, 10:21 PM · Restricted Project

Jan 7 2020

shiva0217 accepted D71593: [DebugInfo] Call site entries cannot be generated for FrameSetup calls.

LGTM, Labels required to describe call site scope will be generated for the calls after FrameSetup instructions. When the SaveLibcall mark as FrameSetup, the Label will not be generated, so constructing call site entry for SaveLibcall will trigger an assertion. Given that SaveLibcall should be part of the prologue, so I think generating call site begin after FrameSetup instructions should be reasonable. But I hope there could be a second look.

Jan 7 2020, 9:29 PM · debug-info, Restricted Project
shiva0217 added a reviewer for D71593: [DebugInfo] Call site entries cannot be generated for FrameSetup calls: dblaikie.
Jan 7 2020, 9:29 PM · debug-info, Restricted Project

Dec 12 2019

shiva0217 added inline comments to D70401: [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs.
Dec 12 2019, 5:19 AM · Restricted Project, Restricted Project, Restricted Project

Dec 9 2019

shiva0217 added inline comments to D62686: [RISCV] Add support for save/restore of callee-saved registers via libcalls.
Dec 9 2019, 8:57 PM · Restricted Project, Restricted Project

Nov 26 2019

shiva0217 added a comment to D70670: [RISCV] Implement canRealignStack.

With the patch, double load/store instructions may unaligned-access with -mabi=ilp32e -mattr=+d flags. Could the load/store support unaligned-access?

Nov 26 2019, 1:38 AM · Restricted Project

Nov 20 2019

shiva0217 added inline comments to D70401: [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs.
Nov 20 2019, 6:25 PM · Restricted Project, Restricted Project, Restricted Project
shiva0217 added inline comments to D70401: [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs.
Nov 20 2019, 12:21 AM · Restricted Project, Restricted Project, Restricted Project

Nov 19 2019

shiva0217 added inline comments to D70401: [RISCV] CodeGen of RVE and ilp32e/lp64e ABIs.
Nov 19 2019, 12:10 AM · Restricted Project, Restricted Project, Restricted Project

Nov 15 2019

shiva0217 committed rGcf6cf0cd147a: [RISCV] Handle variable sized objects with the stack need to be realigned (authored by shiva0217).
[RISCV] Handle variable sized objects with the stack need to be realigned
Nov 15 2019, 8:45 PM
shiva0217 closed D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.
Nov 15 2019, 8:45 PM · Restricted Project
shiva0217 updated the diff for D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.

Rebase to the master

Nov 15 2019, 12:38 AM · Restricted Project

Nov 14 2019

shiva0217 added inline comments to D69723: [RISCV] Fix wrong CFI directives.
Nov 14 2019, 7:40 AM · Restricted Project

Nov 11 2019

shiva0217 added inline comments to D69723: [RISCV] Fix wrong CFI directives.
Nov 11 2019, 9:32 PM · Restricted Project

Nov 7 2019

shiva0217 added a comment to D69723: [RISCV] Fix wrong CFI directives.

Hi @luismarques,
I tried to generate .cfi_remember_state and .cfi_restore_state in emitEpilogue. It could pass the test case.
But there is an issue that .cfi_restore_state will become incorrect if the shrink wrapping hoists the epilogue.
So I think to remove CFI directives from the epilogue as other targets do might be a reasonable step.

Nov 7 2019, 6:36 AM · Restricted Project

Oct 31 2019

shiva0217 accepted D69385: [RISCV] Fix CFA when doing split sp adjustment with fp.

Hi @luismarques, thanks for the patch, LGTM.

Oct 31 2019, 4:49 AM · Restricted Project

Oct 28 2019

shiva0217 committed rGc1498e37abe6: [RISCV] Remove RA from reserved register to use as callee saved register (authored by shiva0217).
[RISCV] Remove RA from reserved register to use as callee saved register
Oct 28 2019, 8:35 PM
shiva0217 closed D67698: [RISCV] Remove RA from reserved register to use as callee saved register.
Oct 28 2019, 8:34 PM · Restricted Project
shiva0217 added inline comments to D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.
Oct 28 2019, 8:22 PM · Restricted Project

Oct 27 2019

shiva0217 requested changes to D69385: [RISCV] Fix CFA when doing split sp adjustment with fp.

Hi @luismarques, thanks for fixing this.

Oct 27 2019, 10:30 PM · Restricted Project
shiva0217 updated the diff for D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.

Add CFI checking line in the test case

Oct 27 2019, 6:54 PM · Restricted Project
shiva0217 added inline comments to D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.
Oct 27 2019, 6:52 PM · Restricted Project

Oct 18 2019

shiva0217 updated the diff for D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.

Update patch to address the comments.

Oct 18 2019, 12:22 AM · Restricted Project

Oct 17 2019

shiva0217 added a comment to D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.

Shiva, I have tried a few workloads like EEMBC, SPEC2000/2006, perennial c++, plumhall.
They don't seem to use variable length arrays nor allocas to test this patch.
Which test suite are you using?

Oct 17 2019, 10:56 PM · Restricted Project

Oct 15 2019

shiva0217 created D68979: [RISCV] Handle variable sized objects with the stack need to be realigned.
Oct 15 2019, 3:11 AM · Restricted Project

Oct 14 2019

shiva0217 updated the diff for D67698: [RISCV] Remove RA from reserved register to use as callee saved register.

Rebase the test case.

Oct 14 2019, 8:04 PM · Restricted Project
shiva0217 committed rG078bec6c48dd: [RISCV] Support fast calling convention (authored by shiva0217).
[RISCV] Support fast calling convention
Oct 14 2019, 7:09 PM
shiva0217 closed D68559: [RISCV] Support fast calling convention.
Oct 14 2019, 7:09 PM · Restricted Project

Oct 12 2019

shiva0217 added inline comments to D62190: [RISCV] Allow shrink wrapping for RISC-V.
Oct 12 2019, 11:34 PM · Restricted Project

Oct 8 2019

shiva0217 added a comment to D68559: [RISCV] Support fast calling convention.

I like this change.

fastcc is LLVM-internal only, right? Checking that we don't have to care about splitting operands that don't fit into registers, or any other psABI details, right?

Yes, to my understanding, fastcc doesn't need to care about psABI details.

Oct 8 2019, 11:26 AM · Restricted Project
shiva0217 updated the diff for D68559: [RISCV] Support fast calling convention.

Update patch to address the feedbacks

Oct 8 2019, 11:25 AM · Restricted Project
shiva0217 updated the diff for D68559: [RISCV] Support fast calling convention.

Update patch to address the comment

Oct 8 2019, 12:20 AM · Restricted Project

Oct 6 2019

shiva0217 created D68559: [RISCV] Support fast calling convention.
Oct 6 2019, 7:16 PM · Restricted Project

Oct 3 2019

shiva0217 committed rGff55e2e0476b: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill… (authored by shiva0217).
[RISCV] Split SP adjustment to reduce the offset of callee saved register spill…
Oct 3 2019, 7:00 PM
shiva0217 updated the diff for D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.

Fix comment in the patch.

Oct 3 2019, 6:50 PM · Restricted Project
shiva0217 added inline comments to D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.
Oct 3 2019, 6:46 PM · Restricted Project

Sep 26 2019

shiva0217 updated the diff for D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.

Add splitting SP adjustment boundary test case as @luismarques suggest.

Sep 26 2019, 9:59 PM · Restricted Project
shiva0217 added a comment to D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.

Update patch

@shiva0217 Thanks for updating the patch and addressing the previous concerns. This is looking quite good. I have just a couple more concerns before approving this:

  • The boundary condition for doing the two-stage sp adjustment probably needs adjustment. For instance, try this:
int main() {
    char xx[2048-16];
    foo(xx);
}
--
        addi    sp, sp, -2032
        sd      ra, 2024(sp)
        addi    sp, sp, -16
...

I think that one would still fit a single-stage sp update. Related to that, where you have the code if (!isInt<12>(StackSize) && (CSI.size() > 0)), be sure that the isInt<12> check properly accounts for the StackSize, CSI size, StackAlign etc. Which brings me to the second point...

  • Please include tests showing that the boundary condition is correctly computed. For instance, one test where the stack size is just enough not to have to split the sp adjustment and another where the adjustment is needed.

Thanks!

Sep 26 2019, 7:01 AM · Restricted Project
shiva0217 updated the diff for D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.

Update patch

Sep 26 2019, 1:14 AM · Restricted Project

Sep 25 2019

shiva0217 updated the diff for D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.

Update patch

  1. Call getFirstSPAdjustAmount() once in per prologue/epilogue generation as @luismarques suggest
  2. Generate CFI directives in large-stack.ll test case to check the CFI generation
Sep 25 2019, 7:24 PM · Restricted Project
shiva0217 updated the diff for D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.

Update patch to address the comments.

Sep 25 2019, 7:49 AM · Restricted Project
shiva0217 added inline comments to D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.
Sep 25 2019, 6:54 AM · Restricted Project
shiva0217 created D68011: [RISCV] Split SP adjustment to reduce the offset of callee saved register spill and restore.
Sep 25 2019, 2:27 AM · Restricted Project

Sep 19 2019

shiva0217 added a comment to D67698: [RISCV] Remove RA from reserved register to use as callee saved register.

We discussed this in the RISC-V meeting on 19 Sep 2019.

  • Pros: GCC for RISC-V and LLVM for ARM and AArch64 seem to do the same. It can help in situations with particularly bad register pressure requirements.
  • Cons: It can make debugging a lot harder, though this seems not to be an issue in GDB for RISC-V.

I think we don't want to have yet another configuration flag to control this.

It would be good to see some performance comparison, but I realise you may not be able to release internal benchmarks, and we have no public benchmarking system for RISC-V.

Sep 19 2019, 10:13 PM · Restricted Project

Sep 18 2019

shiva0217 created D67698: [RISCV] Remove RA from reserved register to use as callee saved register.
Sep 18 2019, 2:03 AM · Restricted Project

Sep 12 2019

shiva0217 committed rGa49a16ddd0eb: [RISCV] Support stack offset exceed 32-bit for RV64 (authored by shiva0217).
[RISCV] Support stack offset exceed 32-bit for RV64
Sep 12 2019, 9:04 PM