Open KanRobert opened 3 months ago
@llvm/issue-subscribers-backend-x86
Author: Shengchen Kan (KanRobert)
CC @FreddyLeaf @RKSimon @phoebewang @topperc @e-kud @goldsteinn
I noticed front end can throw error for wrong scale: https://gcc.godbolt.org/z/699YP5TTq
I noticed front end can throw error for wrong scale: https://gcc.godbolt.org/z/699YP5TTq
Yes. But I am talking about the middle-end and backend to make llvm-reduce work correctly.
For target intrinsics, the front end check is enough. I think llvm-reduce should provide some options to control the reduction rule with target intrinsics.
For target intrinsics, the front end check is enough. I think llvm-reduce should provide some options to control the reduction rule with target intrinsics.
But that option would definitely degrade the ability of llvm-reduce to reduce the test. Could we have sth like ImmArg<ArgIndex<4>, [1, 2, 4, 8]>
?
Why don't we just remove the x86_avx2_gather* intrinsics and auto upgrade them to a gep + masked.gather intrinsic?
For target intrinsics, the front end check is enough. I think llvm-reduce should provide some options to control the reduction rule with target intrinsics.
But that option would definitely degrade the ability of llvm-reduce to reduce the test. Could we have sth like
ImmArg<ArgIndex<4>, [1, 2, 4, 8]>
?
Still, this is something should be improved in llvm-reduce instead of middle-end/backend.
https://www.godbolt.org/z/9T1eGPWjY
llvm/include/llvm/IR/IntrinsicsX86.td
The i8 operand is a scale, and should be 1, 2, 4 or 8. But now the middle end only knows it's 8-bit immediate. So llvm-reduce may assign 0 to the operand and then produce incorrect IR.