Changes

Summary

  1. [X86] Refactor GetSSETypeAtOffset to fix pr51813 (details)
  2. [GlobalOpt] Do not shrink global to bool for an unfavorable AS (details)
Commit e9e1d4751b54126743ed72b1a9178ee51200acf6 by pengfei.wang
[X86] Refactor GetSSETypeAtOffset to fix pr51813

D105263 adds support for _Float16 type. It introduced a bug (pr51813) that generates a <4 x half> type instead the default double when passing blank structure by SSE registers.

Although I doubt it may expose a bug somewhere other than D105263, it's good to avoid return half type when no half type in arguments.

Reviewed By: LuoYuanke

Differential Revision: https://reviews.llvm.org/D109607
The file was modifiedclang/lib/CodeGen/TargetInfo.cpp
The file was modifiedclang/test/CodeGen/X86/avx512fp16-abi.c
Commit 167ff5280d7fcad731810d5d2bf10561ed2adacc by Christudasan.Devadasan
[GlobalOpt] Do not shrink global to bool for an unfavorable AS

Do not call `TryToShrinkGlobalToBoolean` for address spaces
that don't allow initializers. It inserts an initializer value
while shrinking to bool. Used the target hook introduced with
D109337 to skip this call for the restricted address spaces.

Reviewed By: tra

Differential Revision: https://reviews.llvm.org/D109823
The file was addedllvm/test/Transforms/GlobalOpt/shrink-global-to-bool.ll
The file was modifiedllvm/lib/Transforms/IPO/GlobalOpt.cpp