This uses PreprocessISelDAG to replace the constant before
instruction selection instead of matching opcodes after.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | ||
---|---|---|
858 | Can we replace a constant with a reg without checking the operation? |
This patch looks more common than D88194. Is it possible that generate endbr constant after PreprocessISelDAG()?
If this is sufficient, I definitely prefer this implementation - much smaller and easier to understand.
llvm/lib/Target/X86/X86ISelDAGToDAG.cpp | ||
---|---|---|
858 | Cases that require constants should be using ISD::TargetConstant instead of ISD::Constant. I fixed one case I found where it would break in 375849518db97096212f7f2b996b0d15f97be959. There might be others. I'll try to see if I can find a way to check the isel tables for other cases. |
No objections from me and this looks better than D88194
@craig.topper Is there a better way that we can always check for intrinsics that should be using TargetConstant ?
Are we ok with this implementation?
I don't have a great way to protect intrinsics not using TargetConstant properly in the future, but I think we're ok at the moment based on what I see in the isel table.
Can we replace a constant with a reg without checking the operation?
I am afraid it may cause ISEL failed.