[PATCH] D53190: ARM: avoid infinite combining loop

Tim Northover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 12 04:46:54 PDT 2018


t.p.northover created this revision.
Herald added subscribers: chrib, hiraditya, kristof.beyls, mcrosier.
Herald added a reviewer: javed.absar.

One of the transformations done by `PerformCMOVCombine` increases DAG complexity so that one of the output values can be shared with the compare operation (written as a `SUBS`). Since this is the reverse of normal combining, it can be collapsed back later in the worklist, leading to an infinite loop.

I think there was a little existing logic to avoid this (the `LHS != RHS` check) , but it's fragile and nowhere near covers all possible combines; I could not extend it satisfactorily to cover this case and others.

So this patch changes the inserted `ISD::SUB` into a new `ARMISD::OpaqueSUB` with the same semantics but that doesn't undergo combining to avoid the problem.


Repository:
  rL LLVM

https://reviews.llvm.org/D53190

Files:
  llvm/lib/Target/ARM/ARMISelLowering.cpp
  llvm/lib/Target/ARM/ARMISelLowering.h
  llvm/lib/Target/ARM/ARMInstrInfo.td
  llvm/lib/Target/ARM/ARMInstrThumb.td
  llvm/lib/Target/ARM/ARMInstrThumb2.td
  llvm/test/CodeGen/ARM/select.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D53190.169371.patch
Type: text/x-patch
Size: 7172 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181012/cbd3b796/attachment.bin>


More information about the llvm-commits mailing list