[all-commits] [llvm/llvm-project] 6da7db: [GlobalISel]: Allow targets to override how to wid...

proaditya via All-commits all-commits at lists.llvm.org
Tue Dec 3 10:49:29 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 6da7dbb806dce9fbc05416482a5b895efdea96b0
      https://github.com/llvm/llvm-project/commit/6da7dbb806dce9fbc05416482a5b895efdea96b0
  Author: Aditya Nandakumar <aditya_nandakumar at apple.com>
  Date:   2019-12-03 (Tue, 03 Dec 2019)

  Changed paths:
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizerInfo.h
    M llvm/include/llvm/Support/LowLevelTypeImpl.h
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/lib/CodeGen/GlobalISel/LegalizerInfo.cpp
    M llvm/test/CodeGen/ARM/GlobalISel/arm-legalize-consts.mir
    M llvm/test/CodeGen/ARM/GlobalISel/arm-legalize-fp.mir
    M llvm/test/CodeGen/Mips/GlobalISel/legalizer/constants.mir
    M llvm/test/CodeGen/Mips/GlobalISel/legalizer/select.mir
    M llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/constants.ll
    M llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/fcmp.ll
    M llvm/test/CodeGen/Mips/GlobalISel/llvm-ir/select.ll
    M llvm/test/CodeGen/X86/GlobalISel/ashr-scalar.ll
    M llvm/test/CodeGen/X86/GlobalISel/legalize-constant.mir
    M llvm/test/CodeGen/X86/GlobalISel/lshr-scalar.ll
    M llvm/test/CodeGen/X86/GlobalISel/shl-scalar.ll

  Log Message:
  -----------
  [GlobalISel]: Allow targets to override how to widen constants during legalization

https://reviews.llvm.org/D70922

This adds a hook to allow targets to define exactly what extension
operation should be performed for widening constants. This handles cases
like widening i1 true which would end up becoming -1 which affects code
quality during combines.
Additionally, in order to stay consistent with how DAG is promoting
constants, we now signextend for byte sized types and zero extend
otherwise (by default). Targets can of course override this if
necessary.




More information about the All-commits mailing list