[PATCH] D43451: [ARM] Mark -1 as cheap in xor's for thumb1

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 16:05:13 PST 2018


efriedma added inline comments.


================
Comment at: llvm/trunk/lib/Target/ARM/ARMTargetTransformInfo.cpp:131
+  if (Opcode == Instruction::Xor) {
+    int64_t NegImm = Imm.getSExtValue();
+    if (NegImm == -1)
----------------
getSExtValue() will crash if Imm doesn't fit into an int64_t.  Maybe use `isAllOnesValue()`?


Repository:
  rL LLVM

https://reviews.llvm.org/D43451





More information about the llvm-commits mailing list