Skip to content
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

[MCP] Use MachineInstr::all_defs instead of MachineInstr::defs in hasOverlappingMultipleDef. #86889

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Mar 27, 2024

defs does not return the defs for inline assembly. We need to use all_defs to find them.

Need to reduce a test case still.

Fixes #86880.

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 27, 2024

@llvm/pr-subscribers-backend-x86

@llvm/pr-subscribers-llvm-regalloc

Author: Craig Topper (topperc)

Changes

defs does not return the defs for inline assembly. We need to use all_defs to find them.

Need to reduce a test case still.

Fixes #86880.


Full diff: https://github.com/llvm/llvm-project/pull/86889.diff

1 Files Affected:

  • (modified) llvm/lib/CodeGen/MachineCopyPropagation.cpp (+1-1)
diff --git a/llvm/lib/CodeGen/MachineCopyPropagation.cpp b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
index 9a0ab300b21b7a..65c067e4874b17 100644
--- a/llvm/lib/CodeGen/MachineCopyPropagation.cpp
+++ b/llvm/lib/CodeGen/MachineCopyPropagation.cpp
@@ -640,7 +640,7 @@ bool MachineCopyPropagation::hasImplicitOverlap(const MachineInstr &MI,
 /// The umull instruction is unpredictable unless RdHi and RdLo are different.
 bool MachineCopyPropagation::hasOverlappingMultipleDef(
     const MachineInstr &MI, const MachineOperand &MODef, Register Def) {
-  for (const MachineOperand &MIDef : MI.defs()) {
+  for (const MachineOperand &MIDef : MI.all_defs()) {
     if ((&MIDef != &MODef) && MIDef.isReg() &&
         TRI->regsOverlap(Def, MIDef.getReg()))
       return true;

…OverlappingMultipleDef.

defs does not return the defs for inline assembly. We need to use
all_defs to find them.

Need to reduce a test case still.

Fixes llvm#86880.
@topperc topperc merged commit f908135 into llvm:main Mar 28, 2024
5 checks passed
@topperc topperc deleted the pr/mcp-inlineasm branch March 28, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Frame pointer corrupted by __cpuid after #85193
3 participants