[llvm] [llvm][RISCV] Optimize fcopysign for fixed vectors (PR #193802)

Brandon Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 01:59:52 PDT 2026


4vtomat wrote:

> I think I was missing
> 
> ```
> SDValue ClearSignMask = DAG.getConstant(
>      APInt::getSignedMaxValue(IntVT.getScalarSizeInBits()), DL, IntVT);
> ```
> 
> and
> 
> ```
> SDValue SignMask = DAG.getConstant(
>      APInt::getSignMask(IntVT.getScalarSizeInBits()), DL, IntVT);
> ```
> 
> which is probably going to be an `2 * lui + 1 addi`, so I think I need to add 1 in the threshold

Sorry I was wrong, the `2 * lui` will be CSE away, so there's gonna be 1

https://github.com/llvm/llvm-project/pull/193802


More information about the llvm-commits mailing list