You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[DirectX] add Function name to DiagnosticInfoUnsupported Msg in DXILOpLowering
fixesllvm#135654
In llvm#128613 we added safe guards to prevent the lowering of just any intrinsic in the backend. We used `DiagnosticInfoUnsupported` to do this.
What we found was when using `opt` the diagnostic print function was called but when using clang the diagnostic message was used.
Printing message in the clang version means we miss valuable debugging information like function name and function type when LLVMContext was only needed to call `getBestLocationFromDebugLoc`.
There are a few potential fixes
1. Write a custom DiagnosticInfoUnsupported so we can change the Message
just for DirectX. Too heavy handed so rejected.
2. Add the function name to the Message in DirectX code. Very simple one
line change. Downside is
when using opt you see the function name twice. But makes the
clang-dxc bugs more actionable.
3. change CodeGenAction.cpp to always use the print function and not the
message directly. Downside is a bunch of innacurate information shows
up in the message if you don't specify
`-debug-info-kind=standalone`.
4. add some book keeping to know which function called the intrinsic
keep a map of these so we can pass the calling function to
`DiagnosticInfoUnsupported` instead of the intrinsic.
This would only be useful if we had debug info so we could
distinguish different uses of the intrinsic. We would also need to
change from iterating on every function to doing somethin like a
LazyCallGraph.
5. pick a different means of doing a Diagnostic error, because other
uses of`DiagnosticInfoUnsupported` error when we are in the body of a
function not when we see one being used like in the intrinsic case.
This PR went with option 2. Its low code change that also only impacts
the DirectX backend.
0 commit comments