forked from OSchip/llvm-project
5cdf6ed744
Recently a few patches are made to move towards using select i1 instead of and/or i1 to represent "a && b"/"a || b" in C/C++. "a && b" in C/C++ does not evaluate b if a is false whereas 'and a, b' in IR evaluates b and uses its result regardless of the result of a. This is problematic because it can cause miscompilation if b was an erroneous operation (https://llvm.org/pr48353). In C/C++, the result is simply false because b is not evaluated, but in IR the result is poison. The discussion at D93065 has more context about this. This patch makes two branch-splitting optimizations (one in SelectionDAGBuilder, one in CodeGenPrepare) recognize select form of and/or as well using m_LogicalAnd/Or. Since it is CodeGen, I think this is semantically ok (at least as safe as what codegen already did). Reviewed By: nikic Differential Revision: https://reviews.llvm.org/D93853 |
||
---|---|---|
.. | ||
CMakeLists.txt | ||
CSEInfo.cpp | ||
CSEMIRBuilder.cpp | ||
CallLowering.cpp | ||
Combiner.cpp | ||
CombinerHelper.cpp | ||
GISelChangeObserver.cpp | ||
GISelKnownBits.cpp | ||
GlobalISel.cpp | ||
IRTranslator.cpp | ||
InlineAsmLowering.cpp | ||
InstructionSelect.cpp | ||
InstructionSelector.cpp | ||
LegalityPredicates.cpp | ||
LegalizeMutations.cpp | ||
Legalizer.cpp | ||
LegalizerHelper.cpp | ||
LegalizerInfo.cpp | ||
Localizer.cpp | ||
LostDebugLocObserver.cpp | ||
MachineIRBuilder.cpp | ||
RegBankSelect.cpp | ||
RegisterBank.cpp | ||
RegisterBankInfo.cpp | ||
Utils.cpp |