[PATCH] D31077: Improve DAGTypeLegalizer::PromoteIntRes_TRUNCATE() to handle widening.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 20 13:19:42 PDT 2017

efriedma added a comment.

I don't like tests which have constant-foldable operation involving undef; you might get lucky and it won't get folded right now, but that could very easily change in the future; then you aren't testing anything useful anymore.  In this case, you can reduce the testcase to something like this:

  define void @pr32275(<4 x i8> %B15) {
    br label %CF34
    %Tr24 = trunc <4 x i8> %B15 to <4 x i1>
    %E28 = extractelement <4 x i1> %Tr24, i32 3
    br i1 %E28, label %CF34, label %CF36
    ret void

Also, the CHECK lines should check that the test is actually generating some reasonable sequence, as opposed to just checking that it doesn't crash; that verifies the test is actually testing something relevant.


More information about the llvm-commits mailing list