This patch follows https://reviews.llvm.org/D118644 to invert fmul and
fdiv in X86 backend when AVX512 is available.
Details
- Reviewers
spatel RKSimon craig.topper pengfei xbolva00
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
60,070 ms | x64 debian > Clang.CodeGen/RISCV/rvv-intrinsics::vloxseg.c |
Event Timeline
llvm/lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
48950 | / | |
49012–49015 | Equals to return combineBinopWithSelect(N, DAG, Subtarget)? | |
53889 | Or call combineBinopWithSelect directly? | |
llvm/test/CodeGen/X86/vector-bo-select.ll | ||
345–346 | Curiously: it should be equal to vmulps %zmm2, %zmm1, %zmm1 {%k1} vmovaps %zmm1, %zmm0 Why sometimes we use this way, sometime another? |
llvm/lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
48950 | Sorry, I don't understand this comment. | |
49012–49015 | OK, I'll update it. | |
53889 | I prefer to following the current coding convention, so that when there is more to combine we can extent the code in the sub-function. | |
llvm/test/CodeGen/X86/vector-bo-select.ll | ||
345–346 | I guess it is because sometime it is commuted or swapped, sometimes it is not. |
llvm/lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
48950 | X / 1.0 --> X |
llvm/lib/Target/X86/X86ISelLowering.cpp | ||
---|---|---|
48950 | Got it. :) |
Thanks for working on this.
I have a patch to move the existing code over to DAGCombiner with a TLI hook that is only enabled for x86 currently, so it would be effectively NFC.
That would allow us to avoid adding code for custom combining fmul/fdiv to x86 (just add cases for the new opcodes in DAGCombiner).
I'm not sure if one way is more efficient than the other, but let me post that for review.
See D119150.
I think this patch is good either way, but there would be less diffs if we move the existing code over as a first step.
/