Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assertion failure with replay using LLVM 14 #205

Open
sm-hwang opened this issue Feb 23, 2023 · 0 comments
Open

Assertion failure with replay using LLVM 14 #205

sm-hwang opened this issue Feb 23, 2023 · 0 comments

Comments

@sm-hwang
Copy link

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant