forked from OSchip/llvm-project
AMDGPU/GlobalISel: Don't select boolean phi by default
This is currently missing most of the hard parts to lower correctly, so disable it for now. This fixes at least one OpenCL conformance test and allows it to pass with fallback. Hide this behind an option for now.
This commit is contained in:
parent
222e0e58a8
commit
2dd7714b8d
|
@ -39,6 +39,12 @@
|
|||
using namespace llvm;
|
||||
using namespace MIPatternMatch;
|
||||
|
||||
static cl::opt<bool> AllowRiskySelect(
|
||||
"amdgpu-global-isel-risky-select",
|
||||
cl::desc("Allow GlobalISel to select cases that are likely to not work yet"),
|
||||
cl::init(false),
|
||||
cl::ReallyHidden);
|
||||
|
||||
#define GET_GLOBALISEL_IMPL
|
||||
#define AMDGPUSubtarget GCNSubtarget
|
||||
#include "AMDGPUGenGlobalISel.inc"
|
||||
|
@ -196,6 +202,14 @@ bool AMDGPUInstructionSelector::selectCOPY(MachineInstr &I) const {
|
|||
bool AMDGPUInstructionSelector::selectPHI(MachineInstr &I) const {
|
||||
const Register DefReg = I.getOperand(0).getReg();
|
||||
const LLT DefTy = MRI->getType(DefReg);
|
||||
if (DefTy == LLT::scalar(1)) {
|
||||
if (!AllowRiskySelect) {
|
||||
LLVM_DEBUG(dbgs() << "Skipping risky boolean phi\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
LLVM_DEBUG(dbgs() << "Selecting risky boolean phi\n");
|
||||
}
|
||||
|
||||
// TODO: Verify this doesn't have insane operands (i.e. VGPR to SGPR copy)
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
|
||||
; RUN: llc -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck %s
|
||||
; RUN: llc -global-isel -amdgpu-global-isel-risky-select -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck %s
|
||||
|
||||
; Make sure the branch targets are correct after lowering llvm.amdgcn.if
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
|
||||
# RUN: llc -march=amdgcn -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=GCN
|
||||
# RUN: llc -march=amdgcn -amdgpu-global-isel-risky-select -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=GCN
|
||||
|
||||
---
|
||||
name: g_phi_s32_ss_sbranch
|
||||
|
|
Loading…
Reference in New Issue