MemoryLocation::get() does not support CallInst and it errors with llvm_unreachable("unsupported memory instruction");
The current patch avoids calling get() with CallInst.
Details
Details
- Reviewers
• dberlin
Diff Detail
Diff Detail
Event Timeline
Comment Actions
It also will not work for InvokeInst.
This is what the whole MemoryLocOrCall stuff does in MemorySSA.cpp.
You also need to handle fenceinst, etc
You can resolve this by using getModRefInfo, which has versions for calls and not calls
Just explose MemoryLocOrCall and InstructionClobbersQuery from MemorySSA for now and use that.
llvm/lib/Transforms/Scalar/GVNHoist.cpp | ||
---|---|---|
368 | You could do something like: if (AA->getModRef(Insn, DefLoc) != MRI_NoModRef) return true; and that should handle calls. |
You could do something like:
and that should handle calls.