mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
a75ad3c1ca
the definition of the nsw and nuw flags to make use of it. nsw was introduced to help optimizers answer yes to the following: // Can we change i from i32 to i64 to eliminate the cast inside the loop? for (int i = 0; i < n; ++i) A[i] *= 0.1; // Can we assume that this loop will eventually terminate? for (int i = 0; i <= n; ++i) A[i] *= 0.1; In its current form, it isn't truly sufficient for either. In the first case, if the increment overflows, it'll still have some valid i32 value; sign-extending it will produce a value which is 33 homogeneous sign bits trailed by 31 independent undef bits. If i is promoted to i64, it won't have those same values when it reaches that point. (The compiler could recover here by reasoning about how i is used by the load, but that's a lot more complicated and isn't always possible.) In the second case, there is no value for i which will be greater than n, so having the increment return undef on overflow doesn't help. Trap values are a formalization of some existing concepts that we have about LLVM IR, and give the optimizers a better basis for answering yes to both questions above. llvm-svn: 102140 |
||
---|---|---|
.. | ||
CommandGuide | ||
HistoricalNotes | ||
img | ||
tutorial | ||
AliasAnalysis.html | ||
BitCodeFormat.html | ||
Bugpoint.html | ||
CFEBuildInstrs.html | ||
CMake.html | ||
CodeGenerator.html | ||
CodingStandards.html | ||
CommandLine.html | ||
CompilerDriver.html | ||
CompilerDriverTutorial.html | ||
CompilerWriterInfo.html | ||
DebuggingJITedCode.html | ||
DeveloperPolicy.html | ||
doxygen.cfg.in | ||
doxygen.css | ||
doxygen.footer | ||
doxygen.header | ||
doxygen.intro | ||
ExceptionHandling.html | ||
ExtendedIntegerResults.txt | ||
ExtendingLLVM.html | ||
FAQ.html | ||
GarbageCollection.html | ||
GCCFEBuildInstrs.html | ||
GetElementPtr.html | ||
GettingStarted.html | ||
GettingStartedVS.html | ||
GoldPlugin.html | ||
HowToReleaseLLVM.html | ||
HowToSubmitABug.html | ||
index.html | ||
LangRef.html | ||
Lexicon.html | ||
LinkTimeOptimization.html | ||
llvm.css | ||
Makefile | ||
MakefileGuide.html | ||
Packaging.html | ||
Passes.html | ||
ProgrammersManual.html | ||
Projects.html | ||
re_format.7 | ||
ReleaseNotes.html | ||
SourceLevelDebugging.html | ||
SystemLibrary.html | ||
TableGenFundamentals.html | ||
TestingGuide.html | ||
UsingLibraries.html | ||
WritingAnLLVMBackend.html | ||
WritingAnLLVMPass.html |