This is an archive of the discontinued LLVM Phabricator instance.

PR31357 fix
ClosedPublic

Authored by dtemirbulatov on Apr 13 2017, 12:35 PM.

Details

Summary

This patch was introduced by Jim Lewis but it have not been reviewed properly yet, OK to commit?

Diff Detail

Repository
rL LLVM

Event Timeline

dtemirbulatov created this revision.Apr 13 2017, 12:35 PM
RKSimon added inline comments.
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
3887 ↗(On Diff #95184)

Remove braces (style)

3891 ↗(On Diff #95184)

Move this comment before the first if() - it seems to be common to both cases.

test/CodeGen/X86/bswap_tree.ll
4 ↗(On Diff #95184)

Regenerate the codegen with llvm\utils\update_llc_test_checks.py

Also, lease use triples instead of arch/cpu:

; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s
; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=CHECK64
test/CodeGen/X86/bswap_tree2.ll
5 ↗(On Diff #95184)

Regenerate the codegen with llvm\utils\update_llc_test_checks.py

Also, lease use triples instead of arch/cpu:

; RUN: llc < %s -mtriple=i686-unknown | FileCheck %s
; RUN: llc < %s -mtriple=x86_64-unknown | FileCheck %s --check-prefix=CHECK64

update after Simon's comments.

updated the change after rebase.

update again, something went wrong during the last update.

added update to tests.

update test again with utils/update_llc_test_checks.py

RKSimon edited reviewers, added: filcab; removed: llvm-commits.Apr 22 2017, 5:16 AM
RKSimon added a subscriber: llvm-commits.
RKSimon added inline comments.Apr 23 2017, 5:40 AM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
3895 ↗(On Diff #95773)

Style guide says variables should be Capitalized. It might be clearer to call it MaskByteOffset or similar. If possible this should be done as a separate NFC commit.

update after Simon's comments.

spatel added inline comments.Apr 24 2017, 8:32 AM
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
3895 ↗(On Diff #95773)

+1 to making this "MaskByteOffset" and doing that now as NFC, so this patch will be minimized. Also, make the change for Opc0 = N0.getOpcode() ahead of this patch. That should leave us with the actual functional changes.

filcab edited edge metadata.Apr 25 2017, 8:58 AM

I'd rather see this as 3 commits:

  • s/TLI.isOperationLegal/TLI.isOperationLegalOrCustom/
  • Refactor (name changes)
  • Actual fix for PR31357
lib/CodeGen/SelectionDAG/DAGCombiner.cpp
3769 ↗(On Diff #96350)

This looks like a drive-by fix, can you split it?

3962 ↗(On Diff #96350)

Same as above.

Some variable name changes.

Further changes after rebase.

RKSimon accepted this revision.Apr 26 2017, 2:44 AM

LGTM

This revision is now accepted and ready to land.Apr 26 2017, 2:44 AM
This revision was automatically updated to reflect the committed changes.