[PATCH] D27933: [InstCombine] fix operand-complexity-based canonicalization (PR28296)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 3 06:43:28 PST 2017


spatel updated this revision to Diff 86953.
spatel added a comment.

Patch updated:

1. Added code comment with examples to explain the general motivation for complexity-based canonicalization. I'm not sure what the trade-offs are vs. other schemes, so I didn't add more. Please let me know if you'd like to see something else here.

2. Limited 'rank 4' to cast ops and fake unary ops (neg/fneg/not). Cast ops are my motivation for this patch because I've seen problems with those patterns at least 3 times. For reference, the earlier rev included all unary ops, and these are the additional types in that bucket:

Instruction::Alloca  
Instruction::Load  
Instruction::VAArg
Instruction::ExtractValue

There are less test diffs now because we're not distinguishing loads from others instructions.

3. Updated test diffs.


https://reviews.llvm.org/D27933

Files:
  lib/Transforms/InstCombine/InstCombineInternal.h
  test/Transforms/InstCombine/add.ll
  test/Transforms/InstCombine/and.ll
  test/Transforms/InstCombine/apint-sub.ll
  test/Transforms/InstCombine/compare-unescaped.ll
  test/Transforms/InstCombine/icmp.ll
  test/Transforms/InstCombine/narrow.ll
  test/Transforms/InstCombine/or.ll
  test/Transforms/InstCombine/select.ll
  test/Transforms/InstCombine/sub.ll
  test/Transforms/InstCombine/vec_demanded_elts.ll
  test/Transforms/InstCombine/vec_sext.ll
  test/Transforms/InstCombine/x86-avx512.ll
  test/Transforms/InstCombine/xor.ll
  test/Transforms/InstCombine/xor2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27933.86953.patch
Type: text/x-patch
Size: 13921 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170203/8c62b892/attachment.bin>


More information about the llvm-commits mailing list