[PATCH] D76064: [PowerPC][Future] Add initial support for PC Relative addressing for global values that require GOT indirect addressing

Anil Mahmud via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 25 22:43:59 PDT 2020


anil9 added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCISelLowering.cpp:2556
   GlobalAddressSDNode *GSDN = dyn_cast<GlobalAddressSDNode>(N.getNode());
-  bool Global = GSDN && GSDN->getTargetFlags() == PPCII::MO_PCREL_FLAG;
+  bool Global = GSDN && GSDN->getTargetFlags() | PPCII::MO_PCREL_FLAG;
   if (ConstPool || Global) {
----------------
This one and the above conditions, I guess you mistakenly did bitwise OR instead of AND.
And better to put the second line in brackets, may be the precedence of the operations are correct, but given we are doing two types of operations ( logical and bitwise ) having brackets will make it more readable without having to worry about operator precedence.


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

https://reviews.llvm.org/D76064





More information about the llvm-commits mailing list