[PATCH] D77357: [PowerPC][UpdateTestChecks] Remove the extra # when scrubbing loop comments

Zhang Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 2 20:04:29 PDT 2020


ZhangKang created this revision.
ZhangKang added reviewers: kbarton, hiraditya, nemanjai, jsji, steven.zhang, power-llvm-team.
ZhangKang added a project: LLVM.
Herald added subscribers: shchenz, wuzish, arichardson.
ZhangKang added a comment.

The case PR35812-neg-cmpxchg.ll is modified.
For below assembly:

  .LBB0_1: # %L.entry
    # =>This Inner Loop Header: Depth=1
    lharx 3, 0, 5
    cmpw 4, 3
    bne 0, .LBB0_3

The patch D63957 <https://reviews.llvm.org/D63957> will conserve the space: ` # =>This Inner Loop Header: Depth=1` will be replaced as ` #`,
My patch match the `[ \t]*`, so the space will be removed and left only a `#`.


The patch https://reviews.llvm.org/D63957 is to avoid empty string when scrubbing loop comments.

If the line only has loop comments the patch D63957 <https://reviews.llvm.org/D63957> will replace it to a `#`, that's correct.

But if the line has someelse not only loop comments, we will get a extra `#`. 
For example:

  .LBB40_1:                               # =>This Inner Loop Header: Depth=1

The patch D63957 <https://reviews.llvm.org/D63957> will get

  .LBB40_1: #

The patch is to remove the extra `#`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77357

Files:
  llvm/test/CodeGen/PowerPC/PR35812-neg-cmpxchg.ll
  llvm/test/CodeGen/PowerPC/atomics-regression.ll
  llvm/test/CodeGen/PowerPC/loop-comment.ll
  llvm/utils/UpdateTestChecks/asm.py
  llvm/utils/UpdateTestChecks/common.py

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77357.254677.patch
Type: text/x-patch
Size: 182027 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200403/0aa81a40/attachment-0001.bin>


More information about the llvm-commits mailing list