This change fixes a bug in the runtime portion of the CSHIFT intrinsic that happens when the value of the SHIFT argument is negative.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
flang/runtime/transformational.cpp | ||
---|---|---|
187 | llvm style recommends no braces for single statement blocks. |
flang/runtime/transformational.cpp | ||
---|---|---|
187 | I didn't think that we were following this recommendation for flang code. This file, in particular is full of single statement blocks that are enclosed by braces. There's one at line 162, another at line 167, line 232, ... |
flang/runtime/transformational.cpp | ||
---|---|---|
177 | I am shared. I understand why you are doing this interface change to have simpler lowering code, but using a descriptor instead of a simple integer has user runtime cost (creating the descriptor and reading it). |
flang/runtime/transformational.cpp | ||
---|---|---|
177 | I'm not sure what previous problem I was running into, but my latest implementation doesn't require a change to the interface. |
Responding to Jean's comments by reverting my change to the vector version of
CSHIFT.
I am shared. I understand why you are doing this interface change to have simpler lowering code, but using a descriptor instead of a simple integer has user runtime cost (creating the descriptor and reading it).
In this specific case, the extra runtime cost coming from the descriptor might be negligible compared to what CSHIFT is doing, and it's hard for me to complain about performance without any numbers/benchmark. So this change is probably OK.
In general, think we should find solution in lowering to keep lowering code as simple as possible rather than moving the cost to the user.