[PATCH] D70607: [x86] make SLM extract vector element more expensive than default
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 22 12:25:37 PST 2019
RKSimon added inline comments.
================
Comment at: llvm/lib/Target/X86/X86TargetTransformInfo.cpp:2412
+ default: break;
+ }
+
----------------
You should be able to do:
```
int ISD = TLI->InstructionOpcodeToISD(Opcode);
assert(ISD);
```
================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/hadd.ll:302
; SLM-LABEL: @test_v4i64(
-; SLM-NEXT: [[TMP1:%.*]] = shufflevector <4 x i64> [[A:%.*]], <4 x i64> [[B:%.*]], <2 x i32> <i32 0, i32 4>
-; SLM-NEXT: [[TMP2:%.*]] = shufflevector <4 x i64> [[A]], <4 x i64> [[B]], <2 x i32> <i32 1, i32 5>
-; SLM-NEXT: [[TMP3:%.*]] = add <2 x i64> [[TMP1]], [[TMP2]]
-; SLM-NEXT: [[TMP4:%.*]] = shufflevector <4 x i64> [[A]], <4 x i64> [[B]], <2 x i32> <i32 2, i32 6>
-; SLM-NEXT: [[TMP5:%.*]] = shufflevector <4 x i64> [[A]], <4 x i64> [[B]], <2 x i32> <i32 3, i32 7>
-; SLM-NEXT: [[TMP6:%.*]] = add <2 x i64> [[TMP4]], [[TMP5]]
-; SLM-NEXT: [[R03:%.*]] = shufflevector <2 x i64> [[TMP3]], <2 x i64> [[TMP6]], <4 x i32> <i32 0, i32 1, i32 2, i32 3>
-; SLM-NEXT: ret <4 x i64> [[R03]]
+; SLM-NEXT: [[TMP1:%.*]] = shufflevector <4 x i64> [[A:%.*]], <4 x i64> [[B:%.*]], <4 x i32> <i32 0, i32 4, i32 2, i32 6>
+; SLM-NEXT: [[TMP2:%.*]] = shufflevector <4 x i64> [[A]], <4 x i64> [[B]], <4 x i32> <i32 1, i32 5, i32 3, i32 7>
----------------
craig.topper wrote:
> I'm not sure I understand what's happening here. SLM doesn't have 256-bit vectors. Is this going to codegen well?
Probably the cost model type legalization has kicked in. It maybe that its not handling EXTRACT_SUBVECTOR shuffle costs or something so it ends up scalarizing?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D70607/new/
https://reviews.llvm.org/D70607
More information about the llvm-commits
mailing list