This is an archive of the discontinued LLVM Phabricator instance.

[UpdateTestChecks] Drop and update test checks
AbandonedPublic

Authored by xbolva00 on Aug 7 2019, 8:44 AM.

Details

Summary

Motivation: Regeneration of correct test actually breaks it.

Example:

define i32 @test1(i64 %x) nounwind readnone {
  %count = tail call i64 @llvm.ctpop.i64(i64 %x)
  %cast = trunc i64 %count to i32
  %cmp = icmp ugt i32 %cast, 1
  %conv = zext i1 %cmp to i32
  ret i32 %conv
}

; CHECK-LABEL: test1:
; CHECK:       # %bb.0:
; CHECK-NEXT:    leaq -1(%rdi), %rcx
; CHECK-NEXT:    xorl %eax, %eax
; CHECK-NEXT:    testq %rcx, %rdi
; CHECK-NEXT:    setne %al
; CHECK-NEXT:    retq

-> PASS

Script updates it:
define i32 @test1(i64 %x) nounwind readnone {
; CHECK-LABEL: test1:
; CHECK:       # %bb.0:
; CHECK-NEXT:    leaq -1(%rdi), %rcx
; CHECK-NEXT:    xorl %eax, %eax
; CHECK-NEXT:    testq %rcx, %rdi
; CHECK-NEXT:    setne %al
; CHECK-NEXT:    retq
  %count = tail call i64 @llvm.ctpop.i64(i64 %x)
  %cast = trunc i64 %count to i32
  %cmp = icmp ugt i32 %cast, 1
  %conv = zext i1 %cmp to i32
  ret i32 %conv
}

; CHECK-LABEL: test1:
; CHECK:       # %bb.0:
; CHECK-NEXT:    leaq -1(%rdi), %rcx
; CHECK-NEXT:    xorl %eax, %eax
; CHECK-NEXT:    testq %rcx, %rdi
; CHECK-NEXT:    setne %al
; CHECK-NEXT:    retq

-> FAIL

Proposed solution:
-du option: Drop all test checks and then regenerate them.

Diff Detail

Repository
rL LLVM

Event Timeline

xbolva00 created this revision.Aug 7 2019, 8:44 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 7 2019, 8:44 AM
lebedev.ri edited the summary of this revision. (Show Details)Aug 7 2019, 8:51 AM

Hit this issue some time ago in llc area, but I can port it to others..

This is hard-coding CHECK prefix, it wouldn't work for any other prefix,
even if it's specified for FileCheck. Though even then if you re-use the prefixes
from FileCheck, it still will leave check lines that are no longer check
lines because that prefix is no longer mentioned in FileCheck.

In other words, i'm personally honestly not seeing usefulness of this.

xbolva00 abandoned this revision.Aug 7 2019, 9:03 AM