Issue 202481
Summary [DirectX] i8 switch lookup tables need to be legalized
Labels new issue
Assignees
Reporter farzonl
    This simplifyCFG change https://github.com/llvm/llvm-project/pull/202071 has causes switch tables to reduce in size to i8 global arrays.

Now we are seeing failures in the offload test suite for test cases with switch statements  like this one: 
https://github.com/llvm/offload-test-suite/actions/runs/27128916736/job/80064592198#step:13:569
```
# .---command stdout------------
# | Function: main: error: I8 can only be used as immediate value for intrinsic or as i8* via bitcast by lifetime intrinsics.
# | note: at '%switch.gep5 = getelementptr inbounds [3 x i8], [3 x i8]* @switch.table.main, i32 0, i32 %10' in block 'switch.lookup' of function 'main'.
# | Function: main: error: I8 can only be used as immediate value for intrinsic or as i8* via bitcast by lifetime intrinsics.
# | note: at '%11 = load i8, i8* %switch.gep5, align 1' in block 'switch.lookup' of function 'main'.
# | Function: main: error: I8 can only be used as immediate value for intrinsic or as i8* via bitcast by lifetime intrinsics.
# | note: at '%12 = zext i8 %11 to i32' in block 'switch.lookup' of function 'main'.
# | Validation failed.
# | 
# `-----------------------------
```

_Originally posted by @farzonl in https://github.com/llvm/llvm-project/issues/202071#issuecomment-4650421187_
 
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to