[PATCH] D12345: [Reassociate]: Add intermediate subtract instructions created while negating to be redone later for more reassociate opportunities

Aditya Nandakumar via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 25 16:21:37 PDT 2015


aditya_nandakumar created this revision.
aditya_nandakumar added reviewers: llvm-commits, majnemer.
aditya_nandakumar set the repository for this revision to rL LLVM.

This is tackling the same issue as in http://reviews.llvm.org/D12096. Reassociate is currently unable to simplify expressions such as (2 * b - (5 * a - 3 * b))
As David Majnemer pointed out, running reassociate twice did simplify the same.
Redoing the intermediate instructions created while breaking up a subtract (Negating) can open up more opportunities for reassociation and in this case simplifies the above expression to 5 * (b - a)


Repository:
  rL LLVM

http://reviews.llvm.org/D12345

Files:
  lib/Transforms/Scalar/Reassociate.cpp
  test/Transforms/Reassociate/fast-ReassociateVector.ll
  test/Transforms/Reassociate/fast-basictest.ll
  test/Transforms/Reassociate/fast-fp-commute.ll
  test/Transforms/Reassociate/fast-multistep.ll
  test/Transforms/Reassociate/multistep.ll
  test/Transforms/Reassociate/reassoc-intermediate-fnegs.ll
  test/Transforms/Reassociate/secondary.ll
  test/Transforms/Reassociate/xor_reassoc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D12345.33149.patch
Type: text/x-patch
Size: 11738 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150825/1150f9b1/attachment.bin>


More information about the llvm-commits mailing list