[PATCH] D53877: [IR] Strawman for dedicated FNeg IR instruction

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 31 11:47:17 PDT 2018


arsenm added a comment.

Needs some dedicated assembler tests. In particular I would like to see parsing tests with the fast math flags



================
Comment at: include/llvm/Bitcode/LLVMBitCodes.h:479
   FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
 
   FUNC_CODE_INST_PHI = 16, // PHI:        [ty, val0,bb0, ...]
----------------
cameron.mcinally wrote:
> Same thing here about organizing the enum members.
Any guesses for why 14 wasn't used before?


================
Comment at: lib/Bitcode/Writer/BitcodeWriter.cpp:521
+  default: llvm_unreachable("Unknown binary instruction!");
+  // TODO: Handle integer Neg?
+  case Instruction::FNeg: return bitc::UNOP_NEG;
----------------
cameron.mcinally wrote:
> lebedev.ri wrote:
> > There is no integer neg opcode to handle.
> Right, integer Neg is handled the same as FNeg is now. I.e. -0-x (Sub). I'm suggesting that integer Neg should also have a dedicated IR instruction. Although, that case is not as clear cut as it is for FNeg.
I would remove this comment. I don't think there's a reason to have an integer neg


Repository:
  rL LLVM

https://reviews.llvm.org/D53877





More information about the llvm-commits mailing list