Skip to content

Assertion failure with replay using LLVM 14 #205

@sm-hwang

Description

@sm-hwang

While following the CERE tutorial sequentially with LLVM 14.0.0 release, I get this assertion failure at the replay stage.

opt: /home/steven/clang+llvm-14.0.0-aarch64-linux-gnu/include/llvm/IR/Instructions.h:962: static llvm::GetElementPtrInst* llvm::GetElementPtrInst::Create(llvm    ::Type*, llvm::Value*, llvm::ArrayRef<llvm::Value*>, const llvm::Twine&, llvm::Instruction*): Assertion `cast<PointerType>(Ptr->getType()->getScalarType()) ->isOpaqueOrPointeeTypeMatches(PointeeType)\' failed.

I am using the following example and makefile.

// test.c
#include <math.h>

const int large = 1000000;

__attribute__((noinline))double foo(int x) {
  double y = 0;
  for (int i = 1; i < sqrt(x); ++i) {
    y = log(i);
  }
  return y;
}

__attribute__((noinline))int main() {
  for (int i = large; i < 2 * large; ++i) {
    foo(i);
  }
}
CC = cerec
CLD = cerec

test: test.c
        $(CC) -c -gdwarf-4 -O1 test.c -o test.o
        $(CLD) -O1 -gdwarf-4 -v test.o -lm -o test

clean:
        rm -f *.o test

In detail, the sequence of commands I run are:

$ cere configure --build-cmd="make" --clean-cmd="make clean" --run-cmd="./test"
$ cere profile
$ cere regions
$ cere trace --region=__cere__test_foo_7
$ cere selectinv --region=__cere__test_foo_7
$ cere capture --region=__cere__test_foo_7
$ cere replay --region=__cere__test_foo_7 //error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions