[PATCH] D114148: [fir] Add fircg.ext_embox conversion

Valentin Clement via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 30 05:08:17 PST 2021


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


================
Comment at: flang/lib/Optimizer/CodeGen/CodeGen.cpp:1791
+      if (!xbox.substr().empty())
+        base = shiftSubstringBase(rewriter, loc, base, xbox.substr()[0]);
+    }
----------------
kiranchandramohan wrote:
> clementval wrote:
> > kiranchandramohan wrote:
> > > I think the last argument is using the original operand and not the converted operand.
> > Not sure I follow. `xbox.substr()[0]` has no conversion before this use. 
> I meant xbox.substr()[0] is the original substr operand of the XEmbox operation and not the converted operand. In conversion patterns we should use the converted operands. So, shouldn't we access the converted operand using something like operands[xbox.substrOffset()]?
Ah ok! Makes perfect sens. I was looking for a `fir.convert` or smth similar and I didn't even think about operand conversion. 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D114148



More information about the llvm-commits mailing list