[PATCH] D140119: [PowerPC][GIsel] Materialize i64 constants.

Kai Nacke via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 15 11:55:19 PST 2022


Kai added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/GISel/PPCInstructionSelector.cpp:707
+      selectI64ImmDirect(I, MBB, MRI, Reg, Imm & 0xffffffff00000000);
+  if (!Res || !*Res)
+    return false;
----------------
arsenm wrote:
> I don't understand the point of the optional, just make it a bool
The function has 3 outcomes: It returns the result from `constrainAllUses()` (a bool), but it can also fail to produce a an instruction if none of the pattern the pattern matches.
If I just return a bool, then I have to assume that `constrainAllUses()` always returns `true`. Is that ok?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D140119/new/

https://reviews.llvm.org/D140119



More information about the llvm-commits mailing list