[llvm] Add option to turn off optimization for X86 assembler (PR #75895)

Yi Kong via llvm-commits llvm-commits at lists.llvm.org
Sun Jan 28 22:32:09 PST 2024


================
@@ -3670,11 +3674,11 @@ bool X86AsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
 }
 
 bool X86AsmParser::processInstruction(MCInst &Inst, const OperandVector &Ops) {
-  if (ForcedVEXEncoding != VEXEncoding_VEX3 &&
+  if (AsmOptimize && ForcedVEXEncoding != VEXEncoding_VEX3 &&
       X86::optimizeInstFromVEX3ToVEX2(Inst, MII.get(Inst.getOpcode())))
     return true;
 
-  if (X86::optimizeShiftRotateWithImmediateOne(Inst))
+  if (AsmOptimize && X86::optimizeShiftRotateWithImmediateOne(Inst))
----------------
kongy wrote:

We ended up implementing the same optimization in our assembler. This change is no longer required.

https://github.com/llvm/llvm-project/pull/75895


More information about the llvm-commits mailing list