[PATCH] D12300: Pass function attributes instead of simple flag in isIntDivCheap target query. Add test cases.

Steve King via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 15:15:57 PDT 2015


srking created this revision.
srking added reviewers: mkuper, escha, joker-eph, llvm-commits.

Changes isIntDivCheap() target query to take function attributes instead of a boolean optimization flag.  Targets can use the function attributes to make more informed size/speed trade-offs, particularly for borderline -Os optimized code.

Refactors default BuildSDIVPow2 to call isIntDivCheap() in order to simplify SDIV by power-of-2 logic.

Adds a new regression test for x86, which is the only in-tree target that implements isIntDivCheap().  The test verifies that -Oz optimization level produces IDIV and -Os optimization level expands to a non-IDIV sequence.


http://reviews.llvm.org/D12300

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86ISelLowering.h
  test/CodeGen/X86/sdiv-pow2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12300.33008.patch
Type: text/x-patch
Size: 6723 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150824/36d06d4c/attachment.bin>


More information about the llvm-commits mailing list