[all-commits] [llvm/llvm-project] d66316: [CostModel][X86] Reduce cost of v2i64 icmp base co...

Simon Pilgrim via All-commits all-commits at lists.llvm.org
Wed Mar 30 01:13:27 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d663166acbe59e4f17e406302552a1a9005204e8
      https://github.com/llvm/llvm-project/commit/d663166acbe59e4f17e406302552a1a9005204e8
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-30 (Wed, 30 Mar 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/test/Analysis/CostModel/X86/arith-overflow.ll
    M llvm/test/Analysis/CostModel/X86/arith-sminmax.ll
    M llvm/test/Analysis/CostModel/X86/arith-ssat.ll
    M llvm/test/Analysis/CostModel/X86/arith-uminmax.ll
    M llvm/test/Analysis/CostModel/X86/arith-usat.ll
    M llvm/test/Analysis/CostModel/X86/fshl.ll
    M llvm/test/Analysis/CostModel/X86/fshr.ll
    M llvm/test/Analysis/CostModel/X86/icmp.ll
    M llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost-inseltpoison.ll
    M llvm/test/Analysis/CostModel/X86/masked-intrinsic-cost.ll
    M llvm/test/Analysis/CostModel/X86/reduce-smax.ll
    M llvm/test/Analysis/CostModel/X86/reduce-smin.ll
    M llvm/test/Analysis/CostModel/X86/reduce-umax.ll
    M llvm/test/Analysis/CostModel/X86/reduce-umin.ll

  Log Message:
  -----------
  [CostModel][X86] Reduce cost of v2i64 icmp base cost on SSE2 targets

Based off the script from D103695, we were exaggerating the cost of the v2i64 comparison expansion using instruction count instead of effective throughput


  Commit: 6697e3354fbe51242729888529d047c646acdab3
      https://github.com/llvm/llvm-project/commit/6697e3354fbe51242729888529d047c646acdab3
  Author: Simon Pilgrim <llvm-dev at redking.me.uk>
  Date:   2022-03-30 (Wed, 30 Mar 2022)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/test/CodeGen/X86/call-rv-marker.ll
    M llvm/test/CodeGen/X86/combine-adc.ll
    M llvm/test/CodeGen/X86/combine-add.ll
    M llvm/test/CodeGen/X86/pr16031.ll
    M llvm/test/CodeGen/X86/scheduler-backtracking.ll
    M llvm/test/CodeGen/X86/setcc.ll

  Log Message:
  -----------
  [X86] combineADC - fold ADC(C1,C2,Carry) -> ADC(0,C1+C2,Carry)

If we're not relying on the flag result, we can fold the constants together into the RHS immediate operand and set the LHS operand to zero, simplifying for further folds.

We could do something similar if the flag result is in use and the constant fold doesn't affect it, but I don't have any real test cases for this yet.

As suggested by @davezarzycki on Issue #35256

Differential Revision: https://reviews.llvm.org/D122482


Compare: https://github.com/llvm/llvm-project/compare/e124f73b52ad...6697e3354fbe


More information about the All-commits mailing list