This is an archive of the discontinued LLVM Phabricator instance.

[LICM][NFC] Fix typo
ClosedPublic

Authored by Marcythm on Apr 14 2021, 5:01 AM.

Details

Summary

fix some typo in LICM.cpp

Diff Detail

Event Timeline

Marcythm created this revision.Apr 14 2021, 5:01 AM
Marcythm requested review of this revision.Apr 14 2021, 5:01 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 14 2021, 5:01 AM
Marcythm added inline comments.Apr 14 2021, 5:05 AM
llvm/lib/Transforms/Scalar/LICM.cpp
560–561

I'm not sure if this is right, but I think it should be closer to what the author wants to express.

Thank you for the typo fixes.

llvm/lib/Transforms/Scalar/LICM.cpp
1352

Why is this removed?

nikic added inline comments.Apr 14 2021, 11:47 AM
llvm/lib/Transforms/Scalar/LICM.cpp
560–561

I don't think the new wording is right: What this is saying is that without this check, the instruction would be sunk, which is legal but pointless. Instead it is completely removed here.

Marcythm added inline comments.Apr 14 2021, 5:05 PM
llvm/lib/Transforms/Scalar/LICM.cpp
560–561

Oh sorry, I read it again and think you are right. Since I’m not a native English speaker, I have some misunderstandings about the comments. Sorry again.

1352

I think that the variable LI is used in the following assertion so there won't be an unused-variable warning.

Marcythm updated this revision to Diff 337587.Apr 14 2021, 5:28 PM

Update comments on line 561.
I think describe it in this way is easier to understand.

Marcythm marked an inline comment as done.Apr 15 2021, 9:19 AM
nikic added inline comments.Apr 15 2021, 9:23 AM
llvm/lib/Transforms/Scalar/LICM.cpp
1352

asserts are not present in NDEBUG builds, which is why this void cast exists.

Marcythm updated this revision to Diff 337794.Apr 15 2021, 9:32 AM

revoke the incorrect removal of void cast.

Marcythm marked 2 inline comments as done.Apr 15 2021, 9:32 AM
Marcythm added inline comments.
llvm/lib/Transforms/Scalar/LICM.cpp
1352

sorry I'm not aware of this, and it's fixed now.

Marcythm updated this revision to Diff 337795.EditedApr 15 2021, 9:34 AM
Marcythm marked an inline comment as done.

add the missing comment back in the last diff.

This revision is now accepted and ready to land.Apr 15 2021, 9:40 AM

Thank you again for your patient explanations!

Harbormaster completed remote builds in B98940: Diff 337794.
This revision was automatically updated to reflect the committed changes.