This is an archive of the discontinued LLVM Phabricator instance.

`update_test_checks.py` incorrectly truncates IR body
ClosedPublic

Authored by bryant on Nov 14 2016, 10:07 AM.

Details

Summary

For instance, for this IR output:

define void @test1(i8* %P, i8* %Q) #1 {
  %i = call {}* @llvm.invariant.start.p0i8(i64 32, i8* %P)
  call void @llvm.memmove.p0i8.p0i8.i32(i8* %Q, i8* %P, i32 32, i32 16, i1 false)
  ret void
}

the util generates these checks:

; CHECK-LABEL: @test1(
; CHECK-NEXT:    [[I:%.*]] = call {

This is pretty bad, since it creates room for llvm-lit to pass when it should
not.

The patch assumes that the received input is (1) prettified output that (2)
comes from opt -S.

Diff Detail

Repository
rL LLVM

Event Timeline

bryant updated this revision to Diff 77831.Nov 14 2016, 10:07 AM
bryant retitled this revision from to `update_test_checks.py` incorrectly truncates IR body.
bryant updated this object.
bryant added reviewers: chandlerc, spatel.
bryant set the repository for this revision to rL LLVM.
bryant added a subscriber: llvm-commits.
bryant updated this revision to Diff 77841.Nov 14 2016, 11:06 AM

Tighten end-of-function match to closing curly brace on single line.

spatel accepted this revision.Nov 15 2016, 8:25 AM
spatel edited edge metadata.

LGTM.

A few general comments:

  1. Although I checked this script in, my python skills are below beginner; for subsequent changes, feel free to find someone that actually knows something about coding in python. :)
  2. There are probably lots of enhancements/bug fixes that could be made in this script; thanks for working on that!
  3. I wanted this script to be a superset of update_llc_test_checks.py, so we could delete the original llc-only script. The only difference in the output that I know of is that I (probably foolishly) made a cosmetic change to include an extra comment line between the checks and the code. If you can make that an option/preference, then we should still be able to delete the original script before they diverge.
This revision is now accepted and ready to land.Nov 15 2016, 8:25 AM
This revision was automatically updated to reflect the committed changes.