This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Remove uses of RISCVII::hasMergeOp from RISCVDAGToDAGISel.cpp
ClosedPublic

Authored by craig.topper on Jun 2 2023, 3:22 PM.

Details

Summary

This property was intended to indicate when RISCVAsmPrinter should
drop the tied source operand when converting to MCInst. Using it
in RISCVDAGToDAGISel distorts what it intended for.

This should remove some changes from D151850.

Diff Detail

Event Timeline

craig.topper created this revision.Jun 2 2023, 3:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 3:22 PM
craig.topper requested review of this revision.Jun 2 2023, 3:22 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2023, 3:22 PM
frasercrmck added inline comments.Jun 5 2023, 1:46 AM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
3195

Might this result in an not-used-in-release warning? I'm not sure what the current idiom is - [[maybe_unused]] or cast to void?

3250–3251

Comment needs updating

reames added a comment.Jun 5 2023, 9:22 AM

Should we introduce a separate hasTiedDest utility? (With possibly a better chosen name?) I think having that might help clarify the difference between the check being performed here and the hasMergeOp routine. I have to admit I'm not completely following your semantic difference, so having a place to explain that in comments might help.

Should we introduce a separate hasTiedDest utility? (With possibly a better chosen name?) I think having that might help clarify the difference between the check being performed here and the hasMergeOp routine. I have to admit I'm not completely following your semantic difference, so having a place to explain that in comments might help.

Maybe the name hasMergeOp is the problem because the documentation did say what it meant.

// Does this instruction have a merge operand that must be removed when        
// converting to MCInst. It will be the first explicit use operand. Used by    
// RVV Pseudos.                                                                
HasMergeOpShift = ForceTailAgnosticShift + 1,                                  
HasMergeOpMask = 1 << HasMergeOpShift,

I think I can remove it from RISCVMCInstLowering too so the distinction won't matter soon.

Address Fraser's review comments.

Add helper method as suggested by @reames

asb accepted this revision.Jun 6 2023, 12:21 AM

LGTM.

This revision is now accepted and ready to land.Jun 6 2023, 12:21 AM