[PATCH] D14853: [PPC]: Peephole optimize small accesss to aligned globals.

Kyle Butt via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 10 16:15:27 PST 2015


iteratee marked an inline comment as done.
iteratee added a comment.

I implemented your suggestion and fired this selectively for power8


================
Comment at: lib/Target/PowerPC/PPCISelDAGToDAG.cpp:4143
@@ +4142,3 @@
+  // processors with fusion.
+  if (PPCSubTarget->hasFusion())
+    return;
----------------
hfinkel wrote:
> But we should do this when optimizing for code size, even on the `P8`:
> 
>   if (PPCSubTarget->hasFusion() && !MF->getFunction()->optForSize())
> 
> or, if this really *hurts* performance on the `P8`, use `optForMinSize()`.
> 
> Also, we don't need to turn this off on the `P8` when there is only a single (non-debug) user because, as the ELF v2 ABI spec points out:
> 
>   addis r4, r3, upper
>   <lbz,lhz,lwz,ld> r4, lower(r4)
> 
> is also good.
> 
Nice catch. I've implemented that.


http://reviews.llvm.org/D14853





More information about the llvm-commits mailing list