[PATCH] D42732: [x86] Fix nasty bug in the x86 backend that is essentially impossible to hit from IR but creates a minefield for MI passes.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 7 01:06:57 PST 2018


chandlerc added a comment.

Ping, love to get a review on the actual functionality here....



================
Comment at: llvm/test/CodeGen/X86/bad-tls-fold.mir:19
+---
+# CHECK-LABEL: or:
+name:            or
----------------
chandlerc wrote:
> probinson wrote:
> > chandlerc wrote:
> > > probinson wrote:
> > > > Drive-by nit:  You don't need the poorly named -LABEL suffix (it doesn't actually identify labels).
> > > I don't understand...
> > > 
> > > My understanding of `CHECK-LABEL` is that it partitions the `CHECK`-reported errors so that its easier to understand them. I want that partition to hook on the label `or` rather than the `orq` instruction, or some other use of the word `or`, so it seems reasonable to include the suffix of `:`? In IR tests we routinely do `CHECK-LABLE: @foo(` to ensure we don't match a function by the name of `@foo.bar`.
> > Oh, I didn't notice the other CHECK lines.  Duh.
> > Please make all the CHECK lines use consistent indentation and comment characters to accommodate the eyesight-challenged. :-P
> I would actually love to do this. However, I'm worried that I actually *need* this format... at least, the existing MIR test I cargo culted from had this. I really agree with you, as it took me forever to even find the CHECKs in that test!
> 
> Anyways, I'll experiment to see if I can get something more readable and still go through the MIR testing layer.
So, I did the experimentation and now (with some helpful pointers from folks on IRC) I understand why this can't be done.

The `CHECK-LABEL` entries are YAML comments. But the actual `CHECK-NOT` entries I want are inside a YAML multi-line scalar and thus cannot use the YAML comment syntax and instead must use a comment syntax recognized by the MIR parser for the multi-line scalar. That's why we node to switch to `;` in the middle.

I have out-dented them as much as I can to make them visually distinct, but I can't do that all the way because YAML multiline scalars are identified via their indent.


Repository:
  rL LLVM

https://reviews.llvm.org/D42732





More information about the llvm-commits mailing list