[PATCH] D71833: [PowerPC] Fix some bugs of the rlwinm folding

qshanz via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 23 03:46:21 PST 2019


steven.zhang created this revision.
steven.zhang added reviewers: shchenz, jsji, nemanjai, PowerPC.
Herald added subscribers: wuzish, kbarton, hiraditya.
Herald added a project: LLVM.

There are some bugs of this folding.

1. We are removing some pattern that which shouldn't.
2. When it is CHECK-NOT in the test, the register type is there, which invalid all the negative tests.
3. Because of 1, we miss to remove some instructions.
4. Some typo in the tests.

It is better to split this patch into several minors. But I think, it is to trivial so, I commit them together. The most important of this patch is the folding of the following is invalid. We cannot remove the rlwinm if the first one is a wrapping mask.

  %2:gprc = RLWINM %1:gprc, 27, 30, 10
  %3:gprc = RLWINM %2:gprc, 19, 0, 12

into

  %3:gprc = RLWINM %1, 14, 11, 12


https://reviews.llvm.org/D71833

Files:
  llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
  llvm/test/CodeGen/PowerPC/fold-rlwinm.mir

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71833.235124.patch
Type: text/x-patch
Size: 4083 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20191223/16058e2b/attachment.bin>


More information about the llvm-commits mailing list