[PATCH] D123796: [RISCV] Don't emit fractional VIDs with negative steps

Fraser Cormack via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 19 01:44:08 PDT 2022


frasercrmck added inline comments.


================
Comment at: llvm/test/CodeGen/RISCV/rvv/fixed-vectors-int-buildvec.ll:642
-; CHECK-NEXT:    vid.v v8
-; CHECK-NEXT:    vsrl.vi v8, v8, 2
-; CHECK-NEXT:    vrsub.vi v8, v8, -5
----------------
craig.topper wrote:
> This code seemed to do the right thing if I did the math correctly
> 
> -5 - (vid / 4)
Yes I think you're right, thanks. The issue is that I got the wrong check for positivity, as there's a case where we make the effective numerator positive and `StepNumerator` is left in the old negative state. I think we should be checking `SplatStepVal` instead.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123796



More information about the llvm-commits mailing list