[PATCH] D81662: [NFC] Use ADT/Bitfields in Instructions

Guillaume Chatelet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 23 07:26:18 PDT 2020


gchatelet marked 2 inline comments as done.
gchatelet added inline comments.


================
Comment at: llvm/lib/Target/AMDGPU/SIISelLowering.cpp:4555
   const auto *CD = cast<ConstantSDNode>(N->getOperand(3));
-  int CondCode = CD->getSExtValue();
+  unsigned CondCode = CD->getZExtValue();
   if (CondCode < ICmpInst::Predicate::FIRST_ICMP_PREDICATE ||
----------------
nhaehnle wrote:
> This change and the one below don't look wrong, but they seem unrelated to what this patch is claiming to achieve.
They //seem// unrelated but they //are// : )
This has to do with `ICmpInst::Predicate` now being explicitly `unsigned` for efficiency reasons.
The comparison below in the if statement would then trigger a warning because we compare `signed` and `unsigned` types.
Changing `Condcode` to `unsigned` makes sure the compiler is happy.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D81662





More information about the llvm-commits mailing list