[PATCH] D104581: [RISCV] Add DAG combine to detect opportunities to replace (i64 (any_extend (i32 X)) with sign_extend.

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jul 24 11:49:27 PDT 2021


craig.topper added a comment.

In D104581#2902007 <https://reviews.llvm.org/D104581#2902007>, @nathanchance wrote:

> This patch causes an infinite loop while compiling the RISC-V Linux kernel's `allmodconfig` target. A simplified reproducer:
>
>   $ cat aspeed-pwm-tacho.i
>   char aspeed_set_pwm_port_fan_ctrl_priv_0_0,
>       aspeed_set_pwm_port_fan_ctrl_fan_ctrl;
>   pwm_store_period, pwm_store_dc_time_on;
>   pwm_store() {
>     pwm_store_period = aspeed_set_pwm_port_fan_ctrl_priv_0_0;
>     pwm_store_period += 1;
>     pwm_store_dc_time_on =
>         aspeed_set_pwm_port_fan_ctrl_fan_ctrl * pwm_store_period / 5;
>     if (pwm_store_dc_time_on)
>       aspeed_set_pwm_port_duty_rising_falling();
>   }
>   
>   $ timeout 5s clang -O0 --target=riscv64-linux-gnu -c -o /dev/null aspeed-pwm-tacho.i; echo $?
>   ...
>   0
>   
>   $ timeout 5s clang -O1 --target=riscv64-linux-gnu -c -o /dev/null aspeed-pwm-tacho.i; echo $?
>   ...
>   0
>   
>   $ timeout 5s clang -O2 --target=riscv64-linux-gnu -c -o /dev/null aspeed-pwm-tacho.i; echo $?
>   ...
>   124

This should prevent the transform for this case https://reviews.llvm.org/D106754


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D104581/new/

https://reviews.llvm.org/D104581



More information about the llvm-commits mailing list