[llvm] 73442da - [X86][NFC] Remove useless code in X86MCCodeEmitter.cpp

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 24 07:24:22 PST 2023


Since the main thing this change does is remove asserts, it seems rather 
questionable to me.  I will leave this to the target maintainers, but 
this looks likely worthy of revert unless there's a stronger 
justification than the commit message implies.

Philip

On 2/21/23 22:03, Shengchen Kan via llvm-commits wrote:
> Author: Shengchen Kan
> Date: 2023-02-22T14:02:47+08:00
> New Revision: 73442daca11e0a6cbd0cfb7c765802eee8110527
>
> URL: https://github.com/llvm/llvm-project/commit/73442daca11e0a6cbd0cfb7c765802eee8110527
> DIFF: https://github.com/llvm/llvm-project/commit/73442daca11e0a6cbd0cfb7c765802eee8110527.diff
>
> LOG: [X86][NFC] Remove useless code in X86MCCodeEmitter.cpp
>
> Neither the switch in A nor the switch in B is fully covered, so we
> don't need write an impossible format there.
>
> Added:
>      
>
> Modified:
>      llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
>
> Removed:
>      
>
>
> ################################################################################
> diff  --git a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
> index 5e9aaeff8b483..d48777b79242a 100644
> --- a/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
> +++ b/llvm/lib/Target/X86/MCTargetDesc/X86MCCodeEmitter.cpp
> @@ -949,7 +949,6 @@ PrefixKind X86MCCodeEmitter::emitVEXOpcodePrefix(int MemOperand,
>     }
>     case X86II::MRM_C0:
>     case X86II::RawFrm:
> -  case X86II::PrefixByte:
>       break;
>     case X86II::MRMDestMemFSIB:
>     case X86II::MRMDestMem: {
> @@ -1246,10 +1245,6 @@ PrefixKind X86MCCodeEmitter::emitREXPrefix(int MemOperand, const MCInst &MI,
>     case X86II::MRM7r:
>       Prefix.setB(MI, CurOp++);
>       break;
> -  case X86II::MRMr0:
> -    llvm_unreachable("MRMr0 format never need REX prefix!");
> -  case X86II::MRMDestMemFSIB:
> -    llvm_unreachable("FSIB format never need REX prefix!");
>     }
>     PrefixKind Kind = Prefix.determineOptimalKind();
>     if (Kind && UsesHighByteReg)
>
>
>          
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list