[PATCH] Prevent hoisting fmul from THEN/ELSE to IF if there is fmsub/fmadd opportunity

hfinkel at anl.gov hfinkel at anl.gov
Fri Jan 30 11:15:39 PST 2015


REPOSITORY
  rL LLVM

================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:339
@@ +338,3 @@
+  /// then/else to before if.
+  virtual bool isProfitableToHoistThenElseCodeToIf(Instruction *I) const;
+
----------------
This name is pretty long. How about just isProfitableToHoist?

================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:6726
@@ +6725,3 @@
+bool
+AArch64TargetLowering::isProfitableToHoistThenElseCodeToIf(Instruction *I)
+  const {
----------------
I think you can make this the default implementation. PPC will want essentially the same implementation.

================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:6731
@@ +6730,3 @@
+
+  //Only care one user case for now
+  if (I->getNumUses() != 1)
----------------
Space before Only.

================
Comment at: lib/Target/AArch64/AArch64ISelLowering.cpp:6743
@@ +6742,3 @@
+  const TargetOptions &Options = getTargetMachine().Options;
+  EVT VT= getValueType(User->getOperand(0)->getType());
+
----------------
Space after VT (you should probably run clang-format on the entire patch)

http://reviews.llvm.org/D7299

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list