Issue 140590
Summary [SPIRV] Lowering of `select` for floats causes verifier errors
Labels new issue
Assignees
Reporter kmpeng
    When compiling the following LLVM IR targeting SPIR-V:
``` llvm
define noundef float @faceforward_no_instcombine_float(i1 noundef %a, float noundef %b, float noundef %c) {
entry:
  %select = select i1 %a, float %b, float %c
 } 
```
We emit invalid machine code due to incorrect register types in the `OpSelectSISCond` instruction:
```
*** Bad machine code: Illegal virtual register for instruction ***
- function: faceforward_no_instcombine_float
- basic block: %bb.1 entry (0x560fe0f01b98)
- instruction: %7:iid = OpSelectSISCond %4:type, %0:iid, %1:fid, %2:fid
- operand 3:   %1:fid
Expected a iID register, but got a fID register

*** Bad machine code: Illegal virtual register for instruction ***
- function:    faceforward_no_instcombine_float
- basic block: %bb.1 entry (0x560fe0f01b98)
- instruction: %7:iid = OpSelectSISCond %4:type, %0:iid, %1:fid, %2:fid
- operand 4:   %2:fid
Expected a iID register, but got a fID register
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to