[PATCH] D42424: [InstCombine] Allow common type conversions to i8/i16

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 2 06:17:54 PST 2018


dmgreen updated this revision to Diff 132575.
dmgreen added a comment.

OK. So the reason it was looping is two parts of InstCombinePhi acting against one another.

FoldPHIArgsIntoPHI (guarded by shouldChangeType) would sink from phi i8(trunc a, trunc b) to trunc(phi i16(a,b)), and SliceUpIllegalIntegerPHI (guarded by !isLegalType) would do the opposite.

I've updated back to an older version here, where we only do the conversion if ToWidth < FromWidth, breaking the cycle. I've also added a test for the infinite recursion case and ran an arm bootstrap/testsuite/other testing, without finding any problems.

I also had a go at ran a ppc64le bootstrap, but couldn't get it to cross-compile correctly, so just used a dummy linker. All the compiles did OK, no timeouts.


https://reviews.llvm.org/D42424

Files:
  lib/Transforms/InstCombine/InstructionCombining.cpp
  test/Transforms/InstCombine/and-narrow.ll
  test/Transforms/InstCombine/phi-timeout.ll
  test/Transforms/InstCombine/should-change-type.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D42424.132575.patch
Type: text/x-patch
Size: 15609 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180202/895a785a/attachment.bin>


More information about the llvm-commits mailing list