[PATCH] D11685: cache OptSize and MinSize attributes in the DAG

Sanjay Patel spatel at rotateright.com
Fri Jul 31 11:42:54 PDT 2015


spatel created this revision.
spatel added reviewers: qcolombet, mkuper, hfinkel.
spatel added a subscriber: llvm-commits.

Fixing MinSize attribute handling to be more consistent was discussed in D11363.

This patch adds bools to the SelectionDAG to cache a function's MinSize and OptSize attributes. The main benefit is that we always make optimizing for size the logical 'or' of these attributes, so we don't have to repeat that logic everywhere.

Quentin made a similar change to the DAGCombiner in r192476:
http://reviews.llvm.org/rL192476

...but here I'm pulling it one level higher, so it can be used in all DAG-related code. 

The test changes confirm that a MinSize attribute alone can now trigger size optimizations (OptSize does not also have to be present).

If this looks ok, we can make a similar patch for machine-level passes.

http://reviews.llvm.org/D11685

Files:
  include/llvm/CodeGen/SelectionDAG.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/Target/AArch64/AArch64ISelLowering.cpp
  lib/Target/ARM/ARMISelLowering.cpp
  lib/Target/X86/X86ISelDAGToDAG.cpp
  lib/Target/X86/X86ISelLowering.cpp
  test/CodeGen/X86/splat-for-size.ll
  test/CodeGen/X86/x86-64-double-shifts-Oz-Os-O2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11685.31145.patch
Type: text/x-patch
Size: 14817 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150731/d5cd926f/attachment.bin>


More information about the llvm-commits mailing list