llvm-project/llvm/lib/Transforms/InstCombine
Juneyoung Lee 3e32b7e127 [InstCombine] Let combineLoadToNewType preserve ABI alignment of the load (PR44543)
Summary:
If aligment on `LoadInst` isn't specified, load is assumed to be ABI-aligned.
And said aligment may be different for different types.
So if we change load type, but don't pay extra attention to the aligment
(i.e. keep it unspecified), we may either overpromise (if the default aligment
of the new type is higher), or underpromise (if the default aligment
of the new type is smaller).

Thus, if no alignment is specified, we need to manually preserve the implied ABI alignment.

This addresses https://bugs.llvm.org/show_bug.cgi?id=44543 by making combineLoadToNewType preserve ABI alignment of the load.

Reviewers: spatel, lebedev.ri

Subscribers: hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72710
2020-01-15 03:20:53 +09:00
..
CMakeLists.txt [cmake] Explicitly mark libraries defined in lib/ as "Component Libraries" 2019-11-21 10:48:08 -08:00
InstCombineAddSub.cpp [InstCombine] Preserve nuw on sub of geps (PR44419) 2020-01-11 11:01:12 +01:00
InstCombineAndOrXor.cpp [InstCombine] try to pull 'not' of select into compare operands 2020-01-07 10:44:23 -05:00
InstCombineAtomicRMW.cpp [Alignment][NFC] Remove StoreInst::setAlignment(unsigned) 2019-10-03 13:17:21 +00:00
InstCombineCalls.cpp [X86][InstCombine] Add constant folding and simplification support for pdep and pext 2019-12-31 15:06:47 -08:00
InstCombineCasts.cpp Revert "[InstCombine] fold zext of masked bit set/clear" 2020-01-08 11:21:21 +01:00
InstCombineCompares.cpp [InstCombine] replace undef elements in vector constant when doing icmp folds (PR44383) 2020-01-03 09:16:57 -05:00
InstCombineInternal.h [InstCombine] Preserve nuw on sub of geps (PR44419) 2020-01-11 11:01:12 +01:00
InstCombineLoadStoreAlloca.cpp [InstCombine] Let combineLoadToNewType preserve ABI alignment of the load (PR44543) 2020-01-15 03:20:53 +09:00
InstCombineMulDivRem.cpp [InstCombine] Z / (1.0 / Y) => (Y * Z) 2020-01-09 10:52:39 -05:00
InstCombinePHI.cpp [InstCombine] Don't use getFirstNonPHI in FoldIntegerTypedPHI 2019-11-14 17:52:01 -08:00
InstCombineSelect.cpp [InstCombine] Expand usub_sat patterns to handle constants 2019-11-30 16:58:01 +00:00
InstCombineShifts.cpp [InstCombine] prevent crashing/assert on shift constant expression (PR44028) 2019-11-17 17:31:09 -05:00
InstCombineSimplifyDemanded.cpp [InstCombine] Canonicalize select immediates 2019-12-19 12:36:46 +00:00
InstCombineTables.td InstCombine/AMDGPU: Add dimension-aware image intrinsics to SimplifyDemanded 2018-06-21 13:37:31 +00:00
InstCombineVectorOps.cpp [InstCombine] replace shuffle's insertelement operand if inserted scalar is not demanded 2019-12-10 10:10:05 -05:00
InstructionCombining.cpp Make helper functions static or move them into anonymous namespaces. NFC. 2020-01-14 14:06:37 +01:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00