forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIR] Allow overriding isSSA, noPhis, noVRegs in MIR input (llvm#108546)
Allow setting the computed properties IsSSA, NoPHIs, NoVRegs for MIR functions in MIR input. The default value is still the computed value. If the property is set to false, the computed result is ignored. Conflicting values (e.g. setting IsSSA where the input MIR is clearly not SSA) lead to an error. Closes llvm#37787
- Loading branch information
Showing
11 changed files
with
170 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
llvm/test/CodeGen/MIR/Generic/machine-function-optionally-computed-properties-conflict.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# RUN: not llc -run-pass none -o /dev/null %s 2>&1 | FileCheck %s | ||
|
||
# Test that computed properties are not conflicting with explicitly set | ||
# properties | ||
|
||
--- | ||
# CHECK: error: {{.*}}: TestNoPhisOverrideConflict has explicit property NoPhi, but contains at least one PHI | ||
name: TestNoPhisOverrideConflict | ||
noPhis: true | ||
tracksRegLiveness: true | ||
body: | | ||
bb.0: | ||
%0:_(s32) = G_IMPLICIT_DEF | ||
bb.1: | ||
%1:_(s32) = PHI %0, %bb.0, %1, %bb.1 | ||
G_BR %bb.1 | ||
... | ||
--- | ||
# CHECK: error: {{.*}}: TestIsSSAOverrideConflict has explicit property IsSSA, but is not valid SSA | ||
name: TestIsSSAOverrideConflict | ||
isSSA: true | ||
body: | | ||
bb.0: | ||
%0:_(s32) = G_IMPLICIT_DEF | ||
%0:_(s32) = G_IMPLICIT_DEF | ||
... | ||
--- | ||
# CHECK: error: {{.*}}: TestNoVRegsOverrideConflict has explicit property NoVRegs, but contains virtual registers | ||
name: TestNoVRegsOverrideConflict | ||
noVRegs: true | ||
body: | | ||
bb.0: | ||
%0:_(s32) = G_IMPLICIT_DEF | ||
... |
64 changes: 64 additions & 0 deletions
64
llvm/test/CodeGen/MIR/Generic/machine-function-optionally-computed-properties.mir
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# RUN: llc -run-pass none -o - %s | FileCheck %s | ||
|
||
# Test that we can disable certain properties that are normally computed | ||
|
||
--- | ||
# CHECK-LABEL: name: TestNoPhis | ||
# CHECK: noPhis: true | ||
# CHECK: ... | ||
name: TestNoPhis | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestNoPhisOverride | ||
# CHECK: noPhis: false | ||
# CHECK: ... | ||
name: TestNoPhisOverride | ||
noPhis: false | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestNoPhisOverrideTrue | ||
# CHECK: noPhis: true | ||
# CHECK: ... | ||
name: TestNoPhisOverrideTrue | ||
noPhis: true | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestIsSSA | ||
# CHECK: isSSA: true | ||
# CHECK: ... | ||
name: TestIsSSA | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestIsSSAOverride | ||
# CHECK: isSSA: false | ||
# CHECK: ... | ||
name: TestIsSSAOverride | ||
isSSA: false | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestIsSSAOverrideTrue | ||
# CHECK: isSSA: true | ||
# CHECK: ... | ||
name: TestIsSSAOverrideTrue | ||
isSSA: true | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestNoVRegs | ||
# CHECK: noVRegs: true | ||
# CHECK: ... | ||
name: TestNoVRegs | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestNoVRegsOverride | ||
# CHECK: noVRegs: false | ||
# CHECK: ... | ||
name: TestNoVRegsOverride | ||
noVRegs: false | ||
... | ||
--- | ||
# CHECK-LABEL: name: TestNoVRegsOverrideTrue | ||
# CHECK: noVRegs: true | ||
# CHECK: ... | ||
name: TestNoVRegsOverrideTrue | ||
noVRegs: true | ||
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters