[PATCH] D90610: [Inline] Fix in handling of ptrtoint in InlineCost

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 2 09:34:39 PST 2020


spatel added a reviewer: efriedma.
spatel added inline comments.


================
Comment at: llvm/lib/Analysis/InlineCost.cpp:1124
+      else {
+        APInt OffsetWithCorrectSize = BaseAndOffset.second.sext(IntegerSize);
+        std::pair<Value *, APInt> BaseAndOffsetWithCorrectSize =
----------------
uabelho wrote:
> I don't know if sext is what we want to do here, of it that may lead to problems?
Signed math is what I would expect based on:
http://llvm.org/docs/LangRef.html#getelementptr-instruction
"These integers are treated as signed values where relevant."
...and we do similar in GEPOperator::accumulateConstantOffset() for example.



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D90610



More information about the llvm-commits mailing list