File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change 1
1
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2
2
; RUN: llc -mtriple=aarch64 -global-isel=0 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-SD
3
3
; RUN: llc -mtriple=aarch64 -global-isel=1 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI
4
+ ; RUN: llc -mtriple=aarch64 -global-isel=1 -mattr=+fullfp16,+bf16 -verify-machineinstrs %s -o - | FileCheck %s --check-prefixes=CHECK,CHECK-GI
4
5
5
6
define float @fptrunc_f64_f32 (double %a ) {
6
7
; CHECK-LABEL: fptrunc_f64_f32:
Original file line number Diff line number Diff line change @@ -2346,6 +2346,20 @@ void GlobalISelEmitter::emitRunCustomAction(raw_ostream &OS) {
2346
2346
<< " }\n " ;
2347
2347
}
2348
2348
2349
+ bool hasBFloatType (const TreePatternNode &Node) {
2350
+ for (unsigned I = 0 , E = Node.getNumTypes (); I < E; I++) {
2351
+ auto Ty = Node.getType (I);
2352
+ for (auto T : Ty)
2353
+ if (T.second == MVT::bf16 ||
2354
+ (T.second .isVector () && T.second .getScalarType () == MVT::bf16 ))
2355
+ return true ;
2356
+ }
2357
+ for (const TreePatternNode &C : Node.children ())
2358
+ if (hasBFloatType (C))
2359
+ return true ;
2360
+ return false ;
2361
+ }
2362
+
2349
2363
void GlobalISelEmitter::run (raw_ostream &OS) {
2350
2364
if (!UseCoverageFile.empty ()) {
2351
2365
RuleCoverage = CodeGenCoverage ();
@@ -2382,6 +2396,13 @@ void GlobalISelEmitter::run(raw_ostream &OS) {
2382
2396
2383
2397
if (Pat.getGISelShouldIgnore ())
2384
2398
continue ; // skip without warning
2399
+
2400
+ // Skip any patterns containing BF16 types, as GISel cannot currently tell
2401
+ // the difference between fp16 and bf16. FIXME: This can be removed once
2402
+ // BF16 is supported properly.
2403
+ if (hasBFloatType (Pat.getSrcPattern ()))
2404
+ continue ;
2405
+
2385
2406
auto MatcherOrErr = runOnPattern (Pat);
2386
2407
2387
2408
// The pattern analysis can fail, indicating an unsupported pattern.
You can’t perform that action at this time.
0 commit comments