This is an archive of the discontinued LLVM Phabricator instance.

[NFC][InstCombine] Add tests that show a number of canonicalization opportunities
ClosedPublic

Authored by DaniilSuchkov on Oct 1 2019, 2:06 AM.

Diff Detail

Event Timeline

DaniilSuchkov created this revision.Oct 1 2019, 2:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2019, 2:06 AM
lebedev.ri added inline comments.Oct 1 2019, 2:18 AM
llvm/test/Transforms/InstCombine/phi-equal-incoming-pointers.ll
3–6

In general depending on more than one pass in tests is frowned upon.
Does

; RUN: opt -passes=instcombine,verify -S < %s | FileCheck %s --check-prefixes=ALL,INSTCOMBINE

; Make sure GVN won't undo the transformation:
; RUN: opt -passes=instcombine,gvn -S < %s | FileCheck --check-prefixes=ALL,INSTCOMBINEGVN %s

get rid of dedicated ; CHECK-AFTER-GVN check lines?

DaniilSuchkov added inline comments.Oct 1 2019, 3:44 AM
llvm/test/Transforms/InstCombine/phi-equal-incoming-pointers.ll
3–6

Thanks for the suggestion, it simplifies checks for all but two tests. Will update the patch soon.

In general depending on more than one pass in tests is frowned upon.

I don't like it either, so any suggestions on how to get rid of it without compromising reliability of these tests are welcome.

Comment addressed: got rid of duplicating checks with different prefixes.

apilipenko accepted this revision.Nov 11 2019, 5:43 PM
This revision is now accepted and ready to land.Nov 11 2019, 5:43 PM
This revision was automatically updated to reflect the committed changes.