================
@@ -266,7 +266,8 @@ const MachineInstr
*SPIRVGlobalRegistry::createConstOrTypeAtFunctionEntry(
MachineIRBuilder &MIRBuilder,
std::function<MachineInstr *(MachineIRBuilder &)> Op) {
auto oldInsertPoint = MIRBuilder.getInsertPt();
- MachineBasicBlock *OldMBB = &MIRBuilder.getMBB();
+ MachineBasicBlock *OldMBB =
----------------
maarquitos14 wrote:
I'm happy to keep this as an extra safety layer, but the MIRBuilder is passed
in. Should we make the caller set the valid insertion point? That would be the
`G_ANYEXT/G_SEXT/G_ZEXT/G_PTRTOINT` cases in `propagateSPIRVType`, if I'm not
wrong. It creates types without positioning MIB, unlike
`G_CONSTANT/G_GLOBAL_VALUE`. According to my local testing, if we hoist
`MIB.setInsertPt(*MI->getParent(), MI);` above the switch this is fixed too.
https://github.com/llvm/llvm-project/pull/236948
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits