[PATCH] D78547: [TTI] getUserCost to return getCastInstrCost
Sanjay Patel via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 21 10:48:01 PDT 2020
spatel added inline comments.
================
Comment at: llvm/test/Analysis/CostModel/X86/size-cost.ll:33
; CHECK-LABEL: 'bitcast_f64_i64'
-; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r = bitcast double %x to i64
+; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: %r = bitcast double %x to i64
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret i64 %r
----------------
lebedev.ri wrote:
> spatel wrote:
> > samparker wrote:
> > > spatel wrote:
> > > > Let me know if I'm missing larger context, but this is not correct. A cast from xmm <-> gpr ("movq %xmm0, %rax") is not free in any sense on any x86 target AFAIK.
> > > >
> > > > Do we need to fix the x86 override as a preliminary step?
> > > I didn't expect it to be correct.. I'm happy to look into the fix.
> > Sounds good - thanks!
> Is it thought? Note that we test *size* cost here.
> Does `bitcast` instruction itself actually has size cost?
> (does it get lowered to any assembly instructions?)
I was assuming this and the other test requires one of:
movq %xmm0, %rax
movq %rax, %xmm0
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D78547/new/
https://reviews.llvm.org/D78547
More information about the llvm-commits
mailing list