[llvm-commits] [llvm] r163302 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/switch_create.ll test/Transforms/SimplifyCFG/switch_to_lookup_table.ll

Owen Anderson resistor at mac.com
Mon Sep 10 09:09:35 PDT 2012


On Sep 10, 2012, at 12:58 AM, Hans Wennborg <hans at chromium.org> wrote:

> I'm not familiar with GPUs or deeply embedded systems. What are the
> problems that my transformation is creating for them?

My qualm, which I suspect is the same on GPUs and MCUs, is that this kind of transform assumes a CPU-like very of the target's memory map, i.e. we're free to create new global allocations as we wish.  This is fine on your typical CPU, but not on a device whose memory layout is much more constrained.  On a GPU, the lookup table will either have to go in VRAM (very slow) or take up space in local memory (very precious), neither of which the programmer likely intended.  On an MCU, you're taking up valuable Flash or EEPROM space, and also potentially surprising the programmer is they're trying to take fine-grained control of their data and code layout.

I actually really like the transform in principle, I just think there needs to be a mechanism for targets to opt out of it without disabling SimplifyCFG entirely.

--Owen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120910/a8df99ea/attachment.html>


More information about the llvm-commits mailing list