Page MenuHomePhabricator

khchen (Kuan Hsu Chen (Zakk))
User

Projects

User does not belong to any projects.

User Details

User Since
Oct 23 2013, 8:22 AM (317 w, 6 h)

Recent Activity

Yesterday

khchen updated subscribers of rGb6d7bbfa0043: [RISCV] Support mutilib in baremetal environment.
Tue, Nov 19, 6:05 PM
Zakk Chen <zakk.chen@sifive.com> committed rGb6d7bbfa0043: [RISCV] Support mutilib in baremetal environment (authored by khchen).
[RISCV] Support mutilib in baremetal environment
Tue, Nov 19, 2:19 AM
khchen closed D67508: [RISCV] support mutilib in baremetal environment.
Tue, Nov 19, 2:19 AM · Restricted Project

Mon, Nov 18

khchen updated the diff for D67508: [RISCV] support mutilib in baremetal environment.

rebase and fix failed testcases

Mon, Nov 18, 8:26 PM · Restricted Project

Fri, Nov 15

khchen updated the diff for D67508: [RISCV] support mutilib in baremetal environment.

rebase

Fri, Nov 15, 4:47 AM · Restricted Project

Thu, Nov 14

khchen planned changes to D70116: [RISCV] add subtargets initialized with target feature.

I found RISCVABI::computeTargetABI will check ABI with target feature,
so when I apply this patch and enabling lto, the checking get failed and set ABI to ABI_Unknown.
This is a problem because target-features is per-function basis but ABI is not.

Thu, Nov 14, 5:58 AM · Restricted Project

Tue, Nov 12

khchen added a comment to D70116: [RISCV] add subtargets initialized with target feature.

Nice, if this is the correct way to do it, then it's looking good.

I see x86 and arm both inspect the "soft-float" attribute, which seems to come from the -msoft-float clang option. Should RISC-V be using that to switch off the d and f target features?

I think in RISC-V using -mabi is a convention way for specific calling convention in gcc and clang, and more clear than -msoft-float.
but unfortunately compiling source code with -mabi=ilp32 will not generate correct value like "use-soft-float"="true" in bitcode,
so we can fix clang (?) and let backend inspect the "soft-float" attribute, or fix clang driver to pass -mabi to LTO code generator in RISC-V target.

Tue, Nov 12, 7:41 AM · Restricted Project
khchen created D70116: [RISCV] add subtargets initialized with target feature.
Tue, Nov 12, 3:06 AM · Restricted Project

Fri, Nov 8

khchen added inline comments to D67409: [RISCV] enable LTO support, pass some options to linker..
Fri, Nov 8, 3:25 AM · Restricted Project

Sun, Nov 3

khchen set the repository for D67508: [RISCV] support mutilib in baremetal environment to rG LLVM Github Monorepo.
Sun, Nov 3, 7:18 AM · Restricted Project
khchen updated the diff for D67508: [RISCV] support mutilib in baremetal environment.
Sun, Nov 3, 7:09 AM · Restricted Project

Sat, Nov 2

khchen added a comment to D69383: [RISCV] Match GCC `-march`/`-mabi` driver defaults.

LGTM, thanks for the patch!

Sat, Nov 2, 8:34 AM · Restricted Project

Thu, Oct 24

khchen added a comment to D67508: [RISCV] support mutilib in baremetal environment.

@lenary
You patch is very useful to look up the default march, thanks!
But there is some issue if we set the default rv32 march as rv32gc.
Because the default multilib does not include rv32gc/lp32d in riscv gnu toolchain, https://github.com/riscv/riscv-gcc/blob/ed3f6ec/gcc/config/riscv/t-elf-multilib#L19
so if user does not give the default march clang will not find the library and cause linking error.
Do you think this is a clang's problem? or maybe this is just user's problem so they should config multilib to support rv32gc/lip3d2d?

Thu, Oct 24, 11:32 AM · Restricted Project
khchen added inline comments to D69383: [RISCV] Match GCC `-march`/`-mabi` driver defaults.
Thu, Oct 24, 11:12 AM · Restricted Project

Wed, Oct 23

khchen added inline comments to D67508: [RISCV] support mutilib in baremetal environment.
Wed, Oct 23, 10:11 PM · Restricted Project

Oct 15 2019

khchen added inline comments to D67508: [RISCV] support mutilib in baremetal environment.
Oct 15 2019, 10:29 AM · Restricted Project
khchen updated the diff for D67508: [RISCV] support mutilib in baremetal environment.

@lenary Sorry, I don't have the plan to support MULTILIB_REUSE now.
But if it's necessary to support it, I can do it later.

Oct 15 2019, 10:29 AM · Restricted Project

Oct 14 2019

khchen added a comment to D67409: [RISCV] enable LTO support, pass some options to linker..

@khchen do you need me to commit this for you?

Oct 14 2019, 6:52 AM · Restricted Project
khchen updated the diff for D67409: [RISCV] enable LTO support, pass some options to linker..

rebase master,
https://reviews.llvm.org/D66003 changed the riscv::getRISCVTargetFeatures interface.

Oct 14 2019, 2:18 AM · Restricted Project

Sep 24 2019

khchen abandoned D67385: Pass -mcmodel to LTO plugin.
Sep 24 2019, 10:35 PM · Restricted Project
khchen added a comment to D67385: Pass -mcmodel to LTO plugin.

@tejohnson for example:

$ clang -flto a.c -c -o a.o
$ llvm-ar q a.a a.o          // archive libraries      
$ clang -flto a.a b.c -O2 -o main -mcmodel=small 

In above case user need to aware that passing -Wl,-plugin-opt=-code-model=small to plugin is necessary.
It seems to me that is inconvenience because I believe user doesn't know it.

In general, -flto should be transparent to the build process. Think about what happens in your example if you remove -flto:

$ clang a.c -c -o a.o
$ llvm-ar q a.a a.o // archive libraries
$ clang a.a b.c -O2 -o main -mcmodel=small

a.o will be a native code built with the default mcmodel and -O0.

Generally, adding -flto shouldn't change this - I would argue that it would be unexpected to apply mcmodel=small as the user chose to compile a.c with the default mcmodel. We are going more and more toward a model where info is communicated via the IR from the compile step, as the mcmodel already is. Is there a compelling reason why a.c should not get the default mcmodel in this case (without having compiled it mcmodel=small in the first place)?

Sep 24 2019, 10:38 AM · Restricted Project
khchen added a comment to D67385: Pass -mcmodel to LTO plugin.

@tejohnson for example:

$ clang -flto a.c -c -o a.o
$ llvm-ar q a.a a.o          // archive libraries      
$ clang -flto a.a b.c -O2 -o main -mcmodel=small 
Sep 24 2019, 8:57 AM · Restricted Project

Sep 23 2019

khchen added a comment to D67385: Pass -mcmodel to LTO plugin.

@tejohnson when I run the clang -flto -Wl,-plugin-opt=-help command, it shows the

--code-model=<value>                               - Choose code model
  =tiny                                            -   Tiny code model
  =small                                           -   Small code model
  =kernel                                          -   Kernel code model
  =medium                                          -   Medium code model
  =large                                           -   Large code model

so I think the clang driver need to pass this info to LTO codegen, does it make sense?

Sep 23 2019, 7:46 AM · Restricted Project

Sep 22 2019

khchen added a comment to D67508: [RISCV] support mutilib in baremetal environment.

ping

Sep 22 2019, 6:52 AM · Restricted Project
khchen added a comment to D67409: [RISCV] enable LTO support, pass some options to linker..

ping

Sep 22 2019, 6:52 AM · Restricted Project
khchen added a comment to D67385: Pass -mcmodel to LTO plugin.

ping

Sep 22 2019, 6:52 AM · Restricted Project

Sep 18 2019

khchen added inline comments to D67508: [RISCV] support mutilib in baremetal environment.
Sep 18 2019, 9:06 AM · Restricted Project
khchen updated the diff for D67508: [RISCV] support mutilib in baremetal environment.
Sep 18 2019, 9:02 AM · Restricted Project
khchen updated the diff for D67508: [RISCV] support mutilib in baremetal environment.
Sep 18 2019, 8:57 AM · Restricted Project
khchen updated the diff for D67409: [RISCV] enable LTO support, pass some options to linker..

Thanks @lenary, I fixed it.

Sep 18 2019, 7:59 AM · Restricted Project

Sep 15 2019

khchen added a reviewer for D67508: [RISCV] support mutilib in baremetal environment: kito-cheng.
Sep 15 2019, 8:34 PM · Restricted Project

Sep 14 2019

khchen set the repository for D67385: Pass -mcmodel to LTO plugin to rC Clang.
Sep 14 2019, 8:45 AM · Restricted Project
khchen updated the diff for D67385: Pass -mcmodel to LTO plugin.

added a test

Sep 14 2019, 8:35 AM · Restricted Project
khchen updated the diff for D67409: [RISCV] enable LTO support, pass some options to linker..

This commit is inspired by @MaskRay's suggestion, I think maybe fix the insufficient of clang::driver:tools::AddGoldPlugin is good choose.

Sep 14 2019, 8:03 AM · Restricted Project

Sep 12 2019

khchen set the repository for D67508: [RISCV] support mutilib in baremetal environment to rC Clang.
Sep 12 2019, 5:33 PM · Restricted Project
khchen added inline comments to D67409: [RISCV] enable LTO support, pass some options to linker..
Sep 12 2019, 5:24 PM · Restricted Project
khchen created D67508: [RISCV] support mutilib in baremetal environment.
Sep 12 2019, 10:11 AM · Restricted Project
khchen updated the diff for D67409: [RISCV] enable LTO support, pass some options to linker..

@lenary Yes, you are right. add LTO support for Linux platform.

Sep 12 2019, 9:42 AM · Restricted Project

Sep 11 2019

khchen added reviewers for D67385: Pass -mcmodel to LTO plugin: mehdi_amini, dexonsmith.
Sep 11 2019, 7:49 PM · Restricted Project

Sep 10 2019

khchen created D67409: [RISCV] enable LTO support, pass some options to linker..
Sep 10 2019, 11:01 AM · Restricted Project
khchen created D67385: Pass -mcmodel to LTO plugin.
Sep 10 2019, 12:01 AM · Restricted Project

Aug 28 2014

khchen updated subscribers of rL216656: Fix: SLPVectorizer tried to move an instruction which was replaced by a vector….
Aug 28 2014, 1:08 AM
khchen updated subscribers of rL216656: Fix: SLPVectorizer tried to move an instruction which was replaced by a vector….
Aug 28 2014, 1:08 AM