diff options
author | David Green <david.green@arm.com> | 2025-01-27 22:21:12 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-27 22:21:12 +0000 |
commit | 5a81a559d69fb84e1e8ef623ac4b642081c14c51 (patch) | |
tree | ba733fa9490bd2a08e14467aae35d793680c1c08 /llvm/lib/CodeGen/TargetPassConfig.cpp | |
parent | c310b4e7bd2a6e736fbcd8d4885ff46b45ab9977 (diff) | |
download | llvm-5a81a559d69fb84e1e8ef623ac4b642081c14c51.zip llvm-5a81a559d69fb84e1e8ef623ac4b642081c14c51.tar.gz llvm-5a81a559d69fb84e1e8ef623ac4b642081c14c51.tar.bz2 |
[GISel] Explicitly disable BF16 tablegen patterns. (#124113)
We currently have an issue where bf16 patters can be used to match fp16
types, as GISel does not know about the difference between the two. This
patch explicitly disables them to make sure that they are never used.
The opposite can also happen too, where fp16 patterns are used for
operators that should be bf16. So this also changes any operations with
bf16 types to now cause a fallback to SDAG.
The pass setup for GISel has been slightly adjusted to make sure that a
verify pass does not get added between AMD-SDAG and SIFixSGPRCopiesPass,
which otherwise can cause verifier issues when falling back.
Diffstat (limited to 'llvm/lib/CodeGen/TargetPassConfig.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetPassConfig.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/TargetPassConfig.cpp b/llvm/lib/CodeGen/TargetPassConfig.cpp index d8d9f38..847a1ae 100644 --- a/llvm/lib/CodeGen/TargetPassConfig.cpp +++ b/llvm/lib/CodeGen/TargetPassConfig.cpp @@ -1017,7 +1017,7 @@ bool TargetPassConfig::addCoreISelPasses() { if (Selector != SelectorType::GlobalISel || !isGlobalISelAbortEnabled()) DebugifyIsSafe = false; - // Add instruction selector passes. + // Add instruction selector passes for global isel if enabled. if (Selector == SelectorType::GlobalISel) { SaveAndRestore SavedAddingMachinePasses(AddingMachinePasses, true); if (addIRTranslator()) @@ -1043,15 +1043,14 @@ bool TargetPassConfig::addCoreISelPasses() { // Pass to reset the MachineFunction if the ISel failed. addPass(createResetMachineFunctionPass( reportDiagnosticWhenGlobalISelFallback(), isGlobalISelAbortEnabled())); + } - // Provide a fallback path when we do not want to abort on - // not-yet-supported input. - if (!isGlobalISelAbortEnabled() && addInstSelector()) + // Run the SDAG InstSelector, providing a fallback path when we do not want to + // abort on not-yet-supported input. + if (Selector != SelectorType::GlobalISel || !isGlobalISelAbortEnabled()) + if (addInstSelector()) return true; - } else if (addInstSelector()) - return true; - // Expand pseudo-instructions emitted by ISel. Don't run the verifier before // FinalizeISel. addPass(&FinalizeISelID); |