[all-commits] [llvm/llvm-project] 2d9759: [GlobalOpt] Fix the load types when OptimizeGlobal...

Shimin Cui via All-commits all-commits at lists.llvm.org
Tue Aug 3 16:23:48 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2d9759c7902c5cbc9a7e3ab623321d5578d51687
      https://github.com/llvm/llvm-project/commit/2d9759c7902c5cbc9a7e3ab623321d5578d51687
  Author: Shimin Cui <scui at ca.ibm.com>
  Date:   2021-08-03 (Tue, 03 Aug 2021)

  Changed paths:
    M llvm/lib/Transforms/IPO/GlobalOpt.cpp
    A llvm/test/Transforms/GlobalOpt/2021-08-03-StoreOnceLoadMultiCasts.ll

  Log Message:
  -----------
  [GlobalOpt] Fix the load types when OptimizeGlobalAddressOfMalloc

Currently, in OptimizeGlobalAddressOfMalloc, the transformation for global loads assumes that they have the same Type. With the support of ConstantExpr (https://reviews.llvm.org/D106589), this may not be true any more (as seen in the test case), and we miss the code to handle this, This is to fix that.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D107397




More information about the All-commits mailing list