llvm.org GIT mirror llvm / 6726168
fix minsize detection: minsize attribute implies optimizing for size git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244464 91177308-0d34-0410-b5e6-96231b3b80d8 Sanjay Patel 4 years ago
2 changed file(s) with 7 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
52405240
52415241 // Unless optimizing for size, don't fold to avoid partial
52425242 // register update stalls
5243 // FIXME: Use Function::optForSize().
5244 if (!MF.getFunction()->hasFnAttribute(Attribute::OptimizeForSize) &&
5245 hasPartialRegUpdate(MI->getOpcode()))
5243 if (!MF.getFunction()->optForSize() && hasPartialRegUpdate(MI->getOpcode()))
52465244 return nullptr;
52475245
52485246 const MachineFrameInfo *MFI = MF.getFrameInfo();
313313 }
314314 declare i64 @llvm.x86.sse2.cvtsd2si64(<2 x double>) nounwind readnone
315315
316 define float @stack_fold_cvtsd2ss(double %a0) optsize {
316 define float @stack_fold_cvtsd2ss(double %a0) minsize {
317317 ;CHECK-LABEL: stack_fold_cvtsd2ss
318318 ;CHECK: cvtsd2ss {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 8-byte Folded Reload
319319 %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
330330 }
331331 declare <4 x float> @llvm.x86.sse2.cvtsd2ss(<4 x float>, <2 x double>) nounwind readnone
332332
333 define double @stack_fold_cvtsi2sd(i32 %a0) optsize {
333 define double @stack_fold_cvtsi2sd(i32 %a0) minsize {
334334 ;CHECK-LABEL: stack_fold_cvtsi2sd
335335 ;CHECK: cvtsi2sdl {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
336336 %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
364364 }
365365 declare <2 x double> @llvm.x86.sse2.cvtsi642sd(<2 x double>, i64) nounwind readnone
366366
367 define float @stack_fold_cvtsi2ss(i32 %a0) optsize {
367 define float @stack_fold_cvtsi2ss(i32 %a0) minsize {
368368 ;CHECK-LABEL: stack_fold_cvtsi2ss
369369 ;CHECK: cvtsi2ssl {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
370370 %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{rax},~{rbx},~{rcx},~{rdx},~{rsi},~{rdi},~{rbp},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15}"()
398398 }
399399 declare <4 x float> @llvm.x86.sse.cvtsi642ss(<4 x float>, i64) nounwind readnone
400400
401 define double @stack_fold_cvtss2sd(float %a0) optsize {
401 define double @stack_fold_cvtss2sd(float %a0) minsize {
402402 ;CHECK-LABEL: stack_fold_cvtss2sd
403403 ;CHECK: cvtss2sd {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
404404 %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
895895 ; TODO stack_fold_roundsd_int
896896 declare <2 x double> @llvm.x86.sse41.round.sd(<2 x double>, <2 x double>, i32) nounwind readnone
897897
898 define float @stack_fold_roundss(float %a0) optsize {
898 define float @stack_fold_roundss(float %a0) minsize {
899899 ;CHECK-LABEL: stack_fold_roundss
900900 ;CHECK: roundss $1, {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
901901 %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()
967967 ; TODO stack_fold_sqrtsd_int
968968 declare <2 x double> @llvm.x86.sse2.sqrt.sd(<2 x double>) nounwind readnone
969969
970 define float @stack_fold_sqrtss(float %a0) optsize {
970 define float @stack_fold_sqrtss(float %a0) minsize {
971971 ;CHECK-LABEL: stack_fold_sqrtss
972972 ;CHECK: sqrtss {{-?[0-9]*}}(%rsp), {{%xmm[0-9][0-9]*}} {{.*#+}} 4-byte Folded Reload
973973 %1 = tail call <2 x i64> asm sideeffect "nop", "=x,~{xmm1},~{xmm2},~{xmm3},~{xmm4},~{xmm5},~{xmm6},~{xmm7},~{xmm8},~{xmm9},~{xmm10},~{xmm11},~{xmm12},~{xmm13},~{xmm14},~{xmm15},~{flags}"()