| Issue |
91848
|
| Summary |
[Compiling Error][LiveIntervals.cpp] error: invalid use of incomplete type ‘const class llvm::TargetInstrInfo’
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
hlyix
|

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:

**Solution:**
include
`#include "llvm/CodeGen/TargetInstrInfo.h"`
in
`llvm/include/llvm/CodeGen/LiveIntervals.h`
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs