summaryrefslogtreecommitdiffstats
path: root/clang/lib/Format/UsingDeclarationsSorter.cpp
diff options
context:
space:
mode:
authorAyman Musa <ayman.musa@intel.com>2017-12-12 14:13:51 +0000
committerAyman Musa <ayman.musa@intel.com>2017-12-12 14:13:51 +0000
commitc2eed926b0bf3125246bc4737a7f64f5358fa8f7 (patch)
tree84f85a8ddd7859f44dae167555f1668b8076b694 /clang/lib/Format/UsingDeclarationsSorter.cpp
parent2dd9835f351be4dbf2236669ac85fe34ecad6e43 (diff)
downloadbcm5719-llvm-c2eed926b0bf3125246bc4737a7f64f5358fa8f7.tar.gz
bcm5719-llvm-c2eed926b0bf3125246bc4737a7f64f5358fa8f7.zip
[X86] Recognize constant arrays with special values and replace loads from it with subtract and shift instructions, which then will be replaced by X86 BZHI machine instruction.
Recognize constant arrays with the following values: 0x0, 0x1, 0x3, 0x7, 0xF, 0x1F, .... , 2^(size - 1) -1 where //size// is the size of the array. the result of a load with index //idx// from this array is equivalent to the result of the following: (0xFFFFFFFF >> (sub 32, idx)) (assuming the array of type 32-bit integer). And the result of an 'AND' operation on the returned value of such a load and another input, is exactly equivalent to the X86 BZHI instruction behavior. See test cases in the LIT test for better understanding. Differential Revision: https://reviews.llvm.org/D34141 llvm-svn: 320481
Diffstat (limited to 'clang/lib/Format/UsingDeclarationsSorter.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud