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

[Compiling Error][LiveIntervals.cpp] error: invalid use of incomplete type ‘const class llvm::TargetInstrInfo’ #91848

Open
hlyix opened this issue May 11, 2024 · 0 comments

Comments

@hlyix
Copy link

hlyix commented May 11, 2024

image

When I invoke function in TII like:
bool test = TII->isTriviallyReMaterializable(*MI); (An example, no significance)

diff --git a/llvm/lib/CodeGen/LiveIntervals.cpp b/llvm/lib/CodeGen/LiveIntervals.cpp
index 68fff9bc221d..fd53728b54fa 100644
--- a/llvm/lib/CodeGen/LiveIntervals.cpp
+++ b/llvm/lib/CodeGen/LiveIntervals.cpp
@@ -517,6 +517,7 @@ bool LiveIntervals::computeDeadValues(LiveInterval &LI,
       if ((I == LI.begin() || std::prev(I)->end < Def) && !VNI->isPHIDef()) {
         MachineInstr *MI = getInstructionFromIndex(Def);
         MI->setRegisterDefReadUndef(VReg);
+        bool test = TII->isTriviallyReMaterializable(*MI);
       }
     }

it results in compiling error below:
image

Solution:
include
#include "llvm/CodeGen/TargetInstrInfo.h"
in
llvm/include/llvm/CodeGen/LiveIntervals.h

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants