Skip to content

[MIR] Fix return value when computed properties conflict with given prop #109923

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/MIRParser/MIRParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -625,10 +625,10 @@ MIRParserImpl::initializeMachineFunction(const yaml::MachineFunction &YamlMF,
MRI.freezeReservedRegs();

if (computeFunctionProperties(MF, YamlMF))
return false;
return true;

if (initializeCallSiteInfo(PFS, YamlMF))
return false;
return true;

setupDebugValueTracking(MF, PFS, YamlMF);

Expand Down
14 changes: 14 additions & 0 deletions llvm/test/CodeGen/MIR/Generic/machine-function-isssa-conflict.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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: {{.*}}: 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
...
18 changes: 18 additions & 0 deletions llvm/test/CodeGen/MIR/Generic/machine-function-nophis-conflict.mir
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# 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
...
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# 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: {{.*}}: TestNoVRegsOverrideConflict has explicit property NoVRegs, but contains virtual registers
name: TestNoVRegsOverrideConflict
noVRegs: true
body: |
bb.0:
%0:_(s32) = G_IMPLICIT_DEF
...

This file was deleted.

Loading