[llvm-dev] What can cause llc to throw an error for instruction numbering?

Tim Northover via llvm-dev llvm-dev at lists.llvm.org
Mon Jul 8 11:47:09 PDT 2019


On Mon, 8 Jul 2019 at 19:31, Kaarthik Alagapan <kaarthik at knights.ucf.edu> wrote:
> I tested a longer IR code and if I fixed one of the instruction number to the expected one (say from %4 to %5), it tells me that the following line’s instruction number must be the nest odd number (that %5 should be %7). I am guessing that my modification is causing a value to be produced after each allocation instruction, would that still be under LLParser?

I think so. The parsing code is the first thing run on any IR, and
produces the internal representation everything else might use. So
there's just not really any other part of LLVM that could be involved.

The code you're looking for is in the function "SetInstName", and its
diagnostics seem to be derived directly from NumberedVals.size(). So
if it was me I'd be looking for two calls to SetInstName per
instruction, or maybe an out-of-band push to that variable.

Obviously I can't see what code you've written, but it might be worth
double checking any switch statements you've modified to make sure you
haven't left a fallthrough where it shouldn't be. That's the kind of
mistake I could see causing this.

Cheers.

Tim.


More information about the llvm-dev mailing list