[PATCH] D70852: [InstCombine] Guard maxnum/minnum conversions with a TTI query

Jonas Paulsson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 29 05:54:03 PST 2019


jonpa created this revision.
jonpa added reviewers: cameron.mcinally, spatel, uweigand.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

After https://reviews.llvm.org/D62414 "[InstCombine] canonicalize fcmp+select to minnum/maxnum intrinsics", the test-suite no longer builds on earlier subtargets. This was commented on here: https://github.com/llvm/llvm-project/commit/ebf9bf2cbc8fa68d536e481e370c4ba40ce61a8a.

This is an attempt to fix this by guarding this transformation with a query to TTI so that if this would result in a libcall, it is skipped.

I was expecting InstCombine to use TargetTransforminfo, but found that I had to add the TTI member. Is there a reason it should not be used?

With this patch the test-suite now builds again on z10...


https://reviews.llvm.org/D70852

Files:
  llvm/lib/Transforms/InstCombine/InstCombineInternal.h
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
  llvm/test/Transforms/InstCombine/maxnum-02.ll
  llvm/test/Transforms/InstCombine/minnum-02.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70852.231523.patch
Type: text/x-patch
Size: 7905 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191129/345a9008/attachment.bin>


More information about the llvm-commits mailing list