llvm / clangir

A new (MLIR based) high-level IR for clang.
https://clangir.org
Other
351 stars 95 forks source link

Incorrect terminator generation #602

Open wenpen opened 4 months ago

wenpen commented 4 months ago

The following code would generate incorrect terminator, and result in module verification error.

  switch(a) {
  case 0:
    break; 
    int x = 1;
  }
  switch(a) {
  case 0:
    return 0;
    return 1;
    int x = 1;
  }
for (;;) {
  break;
  int x = 1;
}
bcardosolopes commented 4 months ago

Thanks for tracking this

piggynl commented 4 months ago

Hi, I found this issues seems almost identical to #323.

I'd like to make some contribution to clangir. May I ask if @wenpen is already working on this? If so, I'd happy to check out other issues. Thank you!

wenpen commented 4 months ago

Hi @piggynl, I'm working on other issues, so feel free to take it on if you'd like, thanks~