mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
[SelectionDAGBuilder] Use getConstant instead of getTargetConstant to build the offset for struct types in getUniformBase.
getTargetConstant prevents any optimizations from operating on the value and basically says its already been iseled. But since we want the index to be in a register, this isn't true. Prior to this we were generating a vbroadcast with an immediate argument which is illegal and was flagged by the expensive checks bot.
This commit is contained in:
parent
2637a8977b
commit
a0b4517f3d
@ -4390,8 +4390,8 @@ static bool getUniformBase(const Value *&Ptr, SDValue &Base, SDValue &Index,
|
||||
}
|
||||
auto *CI = cast<ConstantInt>(C);
|
||||
Scale = DAG.getTargetConstant(1, SDB->getCurSDLoc(), TLI.getPointerTy(DL));
|
||||
Index = DAG.getTargetConstant(SL->getElementOffset(CI->getZExtValue()),
|
||||
SDB->getCurSDLoc(), TLI.getPointerTy(DL));
|
||||
Index = DAG.getConstant(SL->getElementOffset(CI->getZExtValue()),
|
||||
SDB->getCurSDLoc(), TLI.getPointerTy(DL));
|
||||
} else {
|
||||
Scale = DAG.getTargetConstant(
|
||||
DL.getTypeAllocSize(GEP->getResultElementType()),
|
||||
|
@ -1725,13 +1725,14 @@ define <8 x i32> @gather_v8i32_v8i32(<8 x i32> %trigger) {
|
||||
; AVX512-LABEL: gather_v8i32_v8i32:
|
||||
; AVX512: # %bb.0:
|
||||
; AVX512-NEXT: # kill: def $ymm0 killed $ymm0 def $zmm0
|
||||
; AVX512-NEXT: vptestnmd %zmm0, %zmm0, %k1
|
||||
; AVX512-NEXT: kshiftlw $8, %k1, %k0
|
||||
; AVX512-NEXT: kshiftrw $8, %k0, %k2
|
||||
; AVX512-NEXT: vptestnmd %zmm0, %zmm0, %k0
|
||||
; AVX512-NEXT: kshiftlw $8, %k0, %k0
|
||||
; AVX512-NEXT: kshiftrw $8, %k0, %k1
|
||||
; AVX512-NEXT: vpbroadcastd {{.*#+}} zmm0 = [3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3]
|
||||
; AVX512-NEXT: kmovw %k1, %k2
|
||||
; AVX512-NEXT: vpgatherdd c(,%zmm0,4), %zmm1 {%k2}
|
||||
; AVX512-NEXT: vpbroadcastq $28, %zmm0
|
||||
; AVX512-NEXT: vpgatherqd c(,%zmm0), %ymm2 {%k1}
|
||||
; AVX512-NEXT: vpbroadcastd {{.*#+}} zmm0 = [28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28]
|
||||
; AVX512-NEXT: vpgatherdd c(,%zmm0), %zmm2 {%k1}
|
||||
; AVX512-NEXT: vpaddd %ymm2, %ymm2, %ymm0
|
||||
; AVX512-NEXT: vpaddd %ymm0, %ymm1, %ymm0
|
||||
; AVX512-NEXT: retq
|
||||
|
Loading…
x
Reference in New Issue
Block a user