This is an archive of the discontinued LLVM Phabricator instance.

[X86] Add tests for folding `fmul`/`fdiv` by Pow2 to `add`/`sub` of exp; NFC
ClosedPublic

Authored by goldstein.w.n on Jul 9 2023, 4:00 PM.

Diff Detail

Event Timeline

goldstein.w.n created this revision.Jul 9 2023, 4:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2023, 4:00 PM
Herald added a subscriber: StephenFan. · View Herald Transcript
goldstein.w.n requested review of this revision.Jul 9 2023, 4:00 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 9 2023, 4:00 PM
RKSimon added inline comments.Jul 10 2023, 3:01 AM
llvm/test/CodeGen/X86/fold-int-pow2-with-fmul-or-fdiv.ll
5

These prefixes are broken, they should be more like this:

; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=CHECK-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK-AVX,CHECK-AVX2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK-AVX,CHECK-AVX512F
goldstein.w.n marked an inline comment as done.Jul 10 2023, 10:40 AM
arsenm added inline comments.Jul 21 2023, 1:30 PM
llvm/test/CodeGen/X86/fold-int-pow2-with-fmul-or-fdiv.ll
1265

No i32 cases?

Add i32 tests

goldstein.w.n marked an inline comment as done.Jul 21 2023, 2:42 PM
RKSimon added inline comments.Jul 30 2023, 4:39 AM
llvm/test/CodeGen/X86/fold-int-pow2-with-fmul-or-fdiv.ll
12

add nounwind to silence the cfi noise

goldstein.w.n marked an inline comment as done.Aug 1 2023, 12:33 AM

Remove nounwind tags / rebase

RKSimon added inline comments.Aug 15 2023, 2:54 AM
llvm/test/CodeGen/X86/fold-int-pow2-with-fmul-or-fdiv.ll
5
; RUN: llc < %s -mtriple=x86_64-unknown-unknown | FileCheck %s --check-prefixes=CHECK-SSE
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx2 | FileCheck %s --check-prefixes=CHECK-AVX,CHECK-AVX2
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mattr=+avx512f | FileCheck %s --check-prefixes=CHECK-AVX,CHECK-AVX512F,,CHECK-NO-FASTFMA
; RUN: llc < %s -mtriple=x86_64-unknown-unknown -mcpu=skx -fp-contract=fast | FileCheck %s --check-prefixes=CHECK-AVX,CHECK-AVX512F,CHECK-FMA
goldstein.w.n marked an inline comment as done.Aug 15 2023, 4:32 PM

Update checks

RKSimon accepted this revision.Aug 16 2023, 1:47 AM

LGTM

This revision is now accepted and ready to land.Aug 16 2023, 1:47 AM

Rebase + ldexp